RELEASE: Redirect Routing Plugin for Rails
Here’s another simple plugin hot on the heels of my previous ExceptionTextable plugin: A plugin to add redirects straight in your
First, to install say:
script/plugin source http://svn.pinds.com/rails/plugins script/plugin install redirect_routing
Then add this to your
map.redirect '', :controller => 'events'
And now the root of your site will redirect to the index action of the events controller.
Why not just
map.connect causes the URL in the browser to stay at /, which isn’t very RESTful.
Note that you can also pass a string:
map.redirect 'lars', 'http://pinds.com'
Now /lars will redirect to my blog.
See the README for more details. Enjoy!