calvin-brand-light-mode
calvin-brand-dark-mode
∕
⌘K
About Calvin Podcast We Can Do This Book Speaking
aAbout Calvin
Podcast
wWe Can Do This Book
sSpeaking
Back

RELEASE: Redirect Routing Plugin for Rails

Other
Calvin Correli·Jul 18, 2006· 1 minute

Here’s another simple plugin hot on the heels of my previous ExceptionTextable plugin: A plugin to add redirects straight in your routes.rb file.

First, to install say:

script/plugin source http://svn.pinds.com/rails/plugins
script/plugin install redirect_routing

Then add this to your routes.rb:

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? Because 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!

Previous Assign a keyboard shortcut to ReCSS in Firefox on OS X
Next Apple and Nike

Comments

Write a comment...
00:00 Recording...
calvin-brand-light-mode
calvin-brand-dark-mode
1 Chestnut Hill Plaza #1139
Newark, DE 19713
United States
Copyright © 2026 Calvin Correli
powered by