Back in October 2005, I wrote an article entitled Actions with Dashes. This article is perfectly obsolete and uses a trick instead of the router as it was intended.
Let’s say you want an action where the URL is
http://myproject.com/contact-us. The best way to do that currently is to use Rails’ router:
1 map.contact_us "/contact-us", :controller => "pages", :action => "show", :page => "contact_us"
1 class PagesController < ActionController 2 def show 3 render :action => params[:page] 4 end 5 end
PagesController above is also good for any other static pages you want to serve on your site.