How to add :format options to a named route in Rails

Tuesday, March 23, 2010

# 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"}

This entry was tagged Rails and route

comments powered by Disqus

© 2009-2013 lxneng.com. All rights reserved. Powered by Pyramid

go to Top