I have a controller Admin::Categories in folder controllers/admin
I have a views/admin/categories/index.html.erb which contains:
<%= link_to ‘New category’, new_category_path %>
now if my routes.rb contains:
Then the generated url does not have /admin/ on the front ie it is:
/categories/new which does not work as the controller is in /admin
If I do something that seems to be suggested in the comments in
map.namespace :admin do |admin|
undefined local variable or method `new_category_path’ for
How do I get these fancy named routes to work in the admin namepace?
I could have bunged in :controller=>‘categories’ , :action=>‘new’
However we are told that these named routes are smarter…?
Any help appreciated