Created
March 14, 2010 03:00
-
-
Save lxneng/331739 to your computer and use it in GitHub Desktop.
How to add :format options to a named route in Rails
This file contains hidden or 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
# Add .format in your path specification, like this: | |
map.profile '/:profile.:format', :controller => 'users', :action => 'show' | |
# Then you'll end up with: | |
profile /:profile(.:format) {:action=>"show", :controller=>"users"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment