One method of making the parameters a little more friendly without writing fully custom routes is
# docs_controller.rb
def show
@doc = Doc.find(params[:doc].to_i)
end
# doc.rb
def to_param
[ id, permalink ].join("-")
# assumes you're storing a permalink formatted version of the name of your doc
end
# routes.rb
map.resources :docs
This will give you URLs that look something like example.com/docs/234-the-name-of-your-doc
bensie
2009-11-21 18:36:10