Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

Can't access rails/routes if a before_filter uses a route #22

Closed
dpmccabe opened this issue Jan 16, 2013 · 4 comments
Closed

Can't access rails/routes if a before_filter uses a route #22

dpmccabe opened this issue Jan 16, 2013 · 4 comments

Comments

@dpmccabe
Copy link

I recently upgraded from Sextant 0.1.3 to 0.2.2 and found myself unable to view /rails/routes. I would get the standard Routing Error: No route matches error.

The missing route was referenced in a before_filter I define in ApplicationController to send a route to gon:

before_filter :set_gon_paths

def set_gon_paths
  gon.refresh_navigation_path = refresh_navigation_path
end

If I comment out the before_filter before I access /rails/routes, it'll work fine. I can then uncomment it and continue to use Sextant normally until I restart the app. I suppose I could also skip the before_filter if requesting Sextant::RoutesController#index.

It's a minor issue with a number of easy workarounds, but I just wanted to document it here in case anyone else has this problem.

@schneems
Copy link
Owner

There is another reported issue around this same problem #21 i'm not sure what causes it. I'll try to reproduce it in an example app. Thanks for reporting

schneems added a commit that referenced this issue Jan 16, 2013
@schneems
Copy link
Owner

I'm still not able to reproduce this in my dummy app. The ApplicationController from sextant should be completely isolated, but perhaps i'm not doing something quite right.

What version of Rails are you running? Do you have an open source or public app that shows this problem perchance?

If not could you try running against github head master: git@github.com:schneems/sextant.git, you can add

:github => 'schneems/sextant'

In your Gemfile. Let me know if that fixes the issue.

@schneems
Copy link
Owner

Can you try 0.2.3. I believe I fixed the error.

@dpmccabe
Copy link
Author

Yes, for me the error is now fixed. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants