I am building my first admin section in Rails and I am struggling with routing problems.
My routes.rb looks like this:
get "admin/menuh"
get 'admin/welcome'
namespace :admin do
resources :users
resources :menuh
resources :menuv
resources :welcome
end
And my views structure looks like views/admin/users/files. If I will set to url address of browser the url localhost:3000/admin/users/new, so I will get the error message No route matches {:controller=>”users”} (it’s in the file views/admin/users/_form.html.erb – this file is generated by scaffold)… so I would like to ask you – where is the problem? Is here anything important, what I am disregarding?
You’ve set up your
form_forlike this, I reckon:Because the route is in a namespace, you need to tell the form that also:
That should help you fix that issue.