I’m adding new method ‘editpass’ to existing REST based User controller.
I want to pass the id to the editpass method which edit does for the edit_user_path
i have added the following in routes.rb
resources :user do
collection do
get 'editpass'
end
end
and
match 'user/:id/editpass' => 'user#editpass'
rake:routes produces following for the editpass :
/user/:id/editpass(.:format) {:action=>"editpass", :controller=>"user"
this routes doesn’t have a path name.
what is the bestway to generate path for the method with id in rails3
Thanks in advance
Senling
That should make user_editpass_path(:id => @user) work.