Named Routing in Rails (getting rid of the ids)
(http://www.semergence.com/archives/2005/12/01/10/02/32/)
In config/routes.rb:
map.project ‘project/:projtitle’ :controller => ‘project’, :action => ’show’
In app/controllers/project_controller.rb:
def show @project = Project.find(:first, :conditions => [’title = ?’,params[:projtitle]]) … end
Or something like that. Assuming your project titles are unique. Then
you can also use project_url (since you have map.project in routes.rb)
for urls in your views, e.g.
<% for project in @projects %> <%= link_to project.title, project_url(:projtitle => project.title) %> … <% end %>