I have following in my routes.rb:
namespace "admin" do
resources :categories
end
resources :categories
and all works well. However, as I remove or comment out: "resources :categories" part
namespace "admin" do
resources :categories
end
#resources :categories
I am getting:
ActionView::Template::Error (undefined method `category_path' for #<#:0x103fcd4c0>):
once accessing /admin/categories
?? thanks
and here is the index view:
<% @admin_categories.each do |admin_category| %>
<tr>
<td><%= link_to 'Show', admin_category %></td>
<td><%= link_to 'Edit', edit_admin_category_path(admin_category) %></td>
<td><%= link_to 'Destroy', admin_category, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New Category', new_admin_category_path %>
and views and controller were generated by:
rails g scaffold_controller Admin/Category
so it is either a bug or I am doing something completely wrong