Skip to content
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

console not working with rails catch all routes #27

Open
gucki opened this issue Aug 3, 2011 · 5 comments
Open

console not working with rails catch all routes #27

gucki opened this issue Aug 3, 2011 · 5 comments

Comments

@gucki
Copy link
Contributor

gucki commented Aug 3, 2011

When you have a route like the following the console does not work because the request if captured by rails before the console middleware gets it.

match ":anything" => "index#routing_error", :constraints => { :anything => /.*/ }

I haven't looked at the source, but I think the order of the middlewares has to be changed.

@rogerleite
Copy link
Contributor

Using "rake middleware", a Rails 3.1 stack is like this:

use ActionDispatch::Static
use Rack::Lock
use #ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x8e231fc
use Rack::Runtime
use Rack::MethodOverride
use Rails::Rack::Logger
use ActionDispatch::ShowExceptions
use ActionDispatch::RemoteIp
use ActionDispatch::Reloader
use ActionDispatch::Callbacks
use ActiveRecord::ConnectionAdapters::ConnectionManagement
use ActiveRecord::QueryCache
use ActionDispatch::Cookies
use ActionDispatch::Session::CookieStore
use ActionDispatch::Flash
use ActionDispatch::ParamsParser
use ActionDispatch::Head
use Rack::ConditionalGet
use Rack::ETag
use ActionDispatch::BestStandardsSupport
use Rack::Webconsole
run Dummy::Application.routes

Reading http://guides.rubyonrails.org/configuring.html#configuring-middleware, we'll need to use:

config.middleware.insert_before or config.middleware.insert_after
at https://github.com/codegram/rack-webconsole/blob/master/lib/rack/webconsole/railtie.rb

I just don't know what Rack app is called when using a "catch all routes".

@txus
Copy link
Member

txus commented Sep 14, 2012

@gucki @rogerleite want to give a try at fixing this? :)

@gucki
Copy link
Contributor Author

gucki commented Sep 17, 2012

Sorry, I'm no longer really using the webconsole and I'm too busy atm.. :(

@rogerleite
Copy link
Contributor

Sorry @txus, i'm very busy too atm :X

@txus
Copy link
Member

txus commented Sep 28, 2012

No worries @rogerleite, we'll keep this open and give it a try as soon as we have a moment :)

@ghost ghost assigned txus Dec 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants