form_for and namespace route
When you use a namespace route like the following:
then if you want to use form_for @user, this is the correct way:
When you use a namespace route like the following:
map.namespace :admin do |a|
a.resources :users
end
then if you want to use form_for @user, this is the correct way:
<% form_for([:admin, @user]) do |f| %>
No comments:
Post a Comment