I have problems getting clear about the new routing system of Rails 3+.
I want to match “/:name” to :controller => :profiles, :action => :show, :name => name
How do I realize this?
I tried with match "/:name" => "profiles#show" but this just uses the :name as :id…
Yours Joern.
With
match "/:name" => "profiles#show"this is going to trigger theshowaction on theprofilescontroller. Inside that controller instance you can access the matched URL fromparams[:name]I assume you are trying to get a Model record by name instead of id, thus you must modify your
showaction. For instance,