Created
November 9, 2011 15:23
-
-
Save ericallam/1351762 to your computer and use it in GitHub Desktop.
Add routes outside of routes.draw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Unfortunately, you still have to create the routes somewhere in routes.rb | |
Your::Application.routes.draw do | |
root :to => 'controller#action' | |
end | |
mapper = ActionDispatch::Routing::Mapper.new(Rails.application.routes) | |
mapper.instance_exec do | |
match '/some/action' => "some#action" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, there. I came across this gist when trying to add a new route. Basically, I want to add a route that is only used in test environment and thought this would be perfect. However, when I tried it didn't work (rails 3.0.9)
Inside
the variable
@valid_conditions
Is set to nil when the routeset is frozen. Any ideas if it is possible to unfreeze it. Or will I need to reinitialize? Thanks in advance