When you have a namespace in your routes.rb like this:
map.namespace :admin do |admin|
admin.resources :users
end
And you like to have a form like this:
<% form_for(@user) do |f| %> <%= f.error_messages %>
Change the form_for in this and you’re good to go!
<% form_for([:admin, @user]) do |f| %> <%= f.error_messages %>
This might save you some time.
Thx for the tip!
I was replacing the form_for(@user) with form_for(@user, :url => admin_user_path(@user))…
Your way is shorter and cleaner.
Geoff
Great!!! Thank you!!!
thanks, you saved my day
Thank you for the fast tip!!
Thanks! That’s a lot easier than how I was doing it.