Skip to content

Instantly share code, notes, and snippets.

@lxneng
Created March 14, 2010 03:00
Show Gist options
  • Save lxneng/331739 to your computer and use it in GitHub Desktop.
Save lxneng/331739 to your computer and use it in GitHub Desktop.
How to add :format options to a named route in Rails
# 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