Comments (14)
api/config/initializers/monkey_patches/letter_opener_web.rb
LetterOpenerWeb::Engine.routes.append do
post 'clear' => 'letters#clear'
post ':id' => 'letters#destroy'
end
from letter_opener_web.
Hey peeps, as of the 2.0 release that just went out this should no longer be a problem since we now use POST
for everything
letter_opener_web/config/routes.rb
Lines 3 to 9 in e277c97
from letter_opener_web.
Which version are you using? Working fine on 1.2.3
from letter_opener_web.
@mmontalvo thank you for your answer, I'm using 1.3.0:
$ bundle list | ag letter
* letter_opener (1.3.0)
* letter_opener_web (1.3.0)
from letter_opener_web.
I switched to 1.3.0 and still working. Which browser are you using? Can you please paste some logs?
from letter_opener_web.
That failed on Chrome and Safari, the log says:
Started POST "/letter_opener/1438089424_07b115c" for 127.0.0.1 at 2015-07-30 14:02:32 -0300
[Rollbar] Reporting exception: No route matches [POST] "/letter_opener/1438089424_07b115c"
[Rollbar] Scheduling payload
[Rollbar] Sending payload
[Rollbar] Got unexpected status code from Rollbar api: 400
[Rollbar] Response: {
"err": 1,
"message": "access token required"
}
[Rollbar] Details: https://rollbar.com/instance/uuid?uuid=f8da38ee-a731-4d42-b092-f9eac380051b (only available if report was successful)
[Rollbar] Exception uuid saved in env: f8da38ee-a731-4d42-b092-f9eac380051b
ActionController::RoutingError (No route matches [POST] "/letter_opener/1438089424_07b115c"):
.bundle/ruby/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
.bundle/ruby/2.2.0/gems/rollbar-1.5.3/lib/rollbar/middleware/rails/show_exceptions.rb:22:in `call_with_rollbar'
.bundle/ruby/2.2.0/gems/newrelic_rpm-3.12.1.298/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
.bundle/ruby/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
.bundle/ruby/2.2.0/gems/newrelic_rpm-3.12.1.298/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
.bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/rack/logger.rb:38:in `call_app'
.bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/rack/logger.rb:20:in `block in call'
.bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/tagged_logging.rb:68:in `block in tagged'
.bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/tagged_logging.rb:26:in `tagged'
.bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/tagged_logging.rb:68:in `tagged'
.bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/rack/logger.rb:20:in `call'
.bundle/ruby/2.2.0/gems/newrelic_rpm-3.12.1.298/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
.bundle/ruby/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
.bundle/ruby/2.2.0/gems/newrelic_rpm-3.12.1.298/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
.bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/runtime.rb:18:in `call'
.bundle/ruby/2.2.0/gems/newrelic_rpm-3.12.1.298/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
.bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
.bundle/ruby/2.2.0/gems/newrelic_rpm-3.12.1.298/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
.bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/lock.rb:17:in `call'
.bundle/ruby/2.2.0/gems/newrelic_rpm-3.12.1.298/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
.bundle/ruby/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/middleware/static.rb:113:in `call'
.bundle/ruby/2.2.0/gems/newrelic_rpm-3.12.1.298/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
.bundle/ruby/2.2.0/gems/rack-timeout-0.2.4/lib/rack/timeout.rb:108:in `call'
.bundle/ruby/2.2.0/gems/newrelic_rpm-3.12.1.298/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
.bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:518:in `call'
.bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/application.rb:164:in `call'
.bundle/ruby/2.2.0/gems/newrelic_rpm-3.12.1.298/lib/new_relic/agent/instrumentation/middleware_tracing.rb:67:in `call'
.bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/content_length.rb:15:in `call'
.bundle/ruby/2.2.0/gems/thin-1.6.3/lib/thin/connection.rb:86:in `block in pre_process'
.bundle/ruby/2.2.0/gems/thin-1.6.3/lib/thin/connection.rb:84:in `catch'
.bundle/ruby/2.2.0/gems/thin-1.6.3/lib/thin/connection.rb:84:in `pre_process'
.bundle/ruby/2.2.0/gems/thin-1.6.3/lib/thin/connection.rb:53:in `process'
.bundle/ruby/2.2.0/gems/thin-1.6.3/lib/thin/connection.rb:39:in `receive_data'
.bundle/ruby/2.2.0/gems/eventmachine-1.0.7/lib/eventmachine.rb:187:in `run_machine'
.bundle/ruby/2.2.0/gems/eventmachine-1.0.7/lib/eventmachine.rb:187:in `run'
.bundle/ruby/2.2.0/gems/thin-1.6.3/lib/thin/backends/base.rb:73:in `start'
.bundle/ruby/2.2.0/gems/thin-1.6.3/lib/thin/server.rb:162:in `start'
.bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/handler/thin.rb:19:in `run'
.bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/server.rb:286:in `start'
.bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/commands/server.rb:80:in `start'
.bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:80:in `block in server'
.bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
.bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `server'
.bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
.bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
/bin/rails:4:in `require'
/bin/rails:4:in `<main>'
Rendered .bundle/ruby/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.4ms)
Rendered .bundle/ruby/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/routes/_route.html.erb (16.2ms)
Rendered .bundle/ruby/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/routes/_route.html.erb (3.8ms)
Rendered .bundle/ruby/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/routes/_table.html.erb (31.2ms)
Rendered .bundle/ruby/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.6ms)
Rendered .bundle/ruby/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (435.0ms)
from letter_opener_web.
I have this problem too. Are there any changes?
I tried gem versions 1.2.3, 1.3.1 and got error in both cases.
from letter_opener_web.
Is this still an issue with master?
from letter_opener_web.
Adding Rack::MethodOverride
middleware to my application helped with the problem:
# config/environments/development.rb
Rails.application.configure do
# ...
config.middleware.use Rack::MethodOverride
end
About Rack::MethodOverride
from https://guides.rubyonrails.org/rails_on_rack.html:
Allows the method to be overridden if params[:_method] is set. This is the middleware which supports the PUT and DELETE HTTP method types.
An API application is not equipped with it - https://edgeguides.rubyonrails.org/api_app.html#choosing-middleware.
from letter_opener_web.
Adding
Rack::MethodOverride
middleware to my application helped with the problem:About `Rack::MethodOverride` from https://guides.rubyonrails.org/rails_on_rack.html:
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 letters#destroy
and letters#clear
: 793b4e8
from letter_opener_web.
Adding
Rack::MethodOverride
middleware to my application helped with the problem:About `Rack::MethodOverride` from https://guides.rubyonrails.org/rails_on_rack.html: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
letters#destroy
andletters#clear
: 793b4e8
This solution probably works but this is still an issue since the button for clear
and destroy
on UI is sending a POST
request instead of DELETE
in the version 1.3.4.
Version:
➜ bundle list | grep letter
* letter_opener (1.7.0)
* letter_opener_web (1.3.4)
from letter_opener_web.
This solution probably works but this is still an issue since the button for
clear
anddestroy
on UI is sending aPOST
request instead ofDELETE
in the version 1.3.4.
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.
from letter_opener_web.
Sorry for the silence here, I might work on this soon #69 (comment)
from letter_opener_web.
Use LetterOpenerWeb::Letter.destroy_all
from rails c
untill this bug is fixed.
from letter_opener_web.
Related Issues (20)
- Does not work with Rails API only HOT 2
- Wrong layout used in rails 5.1.4 HOT 1
- SystemStackError occures when more than 30 messages. HOT 2
- Missing Template Error HOT 2
- Reading application.scss under the node_modules directory? HOT 1
- Empty output on SMIME signed email HOT 4
- Rails 6.0 is out HOT 1
- Bump rails deps requirements to 5.0+ HOT 1
- Update to latest bootstrap release (or use another framework) HOT 4
- ignore
- Missing gem dependency on rexml HOT 2
- clean up fix_link_html method
- Feature Request: Option to avoid launchy altogether
- No route matches [GET] “/bootstrap.min.css.map” HOT 1
- ActionController::InvalidAuthenticityToken in LetterOpenerWeb::LettersController#clear HOT 4
- layout somehow messed up HOT 3
- Not able to upgrade to Rails 7.1
- Getting "xprop: unable to open display" while sending an email in the docker. HOT 1
- Can't disable or toggle the dark theme HOT 2
- Auto-update list of emails
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from letter_opener_web.