(Rails 3) Is it possible to hardcode ids in a named route?
As far as I know, the following is the encouraged way to create a simple named route in Rails 3:
match 'sign-in' =>开发者_开发技巧 'sessions#create', :as => :sign_in
Is there a clean way to hardcode an id (or any parameter) in a named route? For a silly example:
match 'first-user' => 'users#show', :as => :first_user, :id => 1
Did you try that? It just works like that.
精彩评论