Chris Bloom

Chris Bloom

  • Intro
  • Details
  • Blog
  • Facebook
  • Instagram
  • LinkedIn
June 13, 2011

Named redirect routes in Rails 3

I didn’t see this mentioned anywhere in the Rails Guide or in my admittedly cursory Google searches, but apparently it’s possible to create named redirect routes in Rails 3. For example:

[gist id=1024213 file=routes.rb]

Then you can use those in your layouts like so:

[gist id=1024213 file=application.html.erb]

Share this:

  • Share on X (Opens in new window) X
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Reddit (Opens in new window) Reddit
  • More
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Facebook (Opens in new window) Facebook
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Pinterest (Opens in new window) Pinterest
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email

In

Code Snippets

It Should Include Only One Of – An RSpec Matcher
Testing model validations in rspec the short and sweet way

© 2024

Chris Bloom

Theme by Anders Norén

Powered by WordPress