-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DELETE routes are failing #42
Comments
Which version are you using? Working fine on 1.2.3 |
@mmontalvo thank you for your answer, I'm using 1.3.0:
|
I switched to 1.3.0 and still working. Which browser are you using? Can you please paste some logs? |
That failed on Chrome and Safari, the log says:
|
I have this problem too. Are there any changes? |
api/config/initializers/monkey_patches/letter_opener_web.rb LetterOpenerWeb::Engine.routes.append do
post 'clear' => 'letters#clear'
post ':id' => 'letters#destroy'
end |
Is this still an issue with master? |
Adding # config/environments/development.rb
Rails.application.configure do
# ...
config.middleware.use Rack::MethodOverride
end About
An API application is not equipped with it - https://edgeguides.rubyonrails.org/api_app.html#choosing-middleware. |
This was exactly the problem I was facing. I didn't want to pull in that middleware just for a test gem though so I worked around it adding post routes for |
This solution probably works but this is still an issue since the button for Version:
|
That's fairly normal - web browsers don't support sending a real DELETE from a form - only GET and POST. That's why we have the Rack::MethodOverride middleware. Sending a POST is normal here, it's just that usually with that middleware it is correctly translated back to DELETE on the server-side. |
Sorry for the silence here, I might work on this soon #69 (comment) |
Use |
Hey peeps, as of the 2.0 release that just went out this should no longer be a problem since we now use letter_opener_web/config/routes.rb Lines 3 to 9 in e277c97
|
Every time I tried to remove a message or clear all the messages I got this error:
At my router.rb I added:
And this is what I get when I run
rake routes
:For some reason it calls using
POST
but should useDELETE
instead.The text was updated successfully, but these errors were encountered: