i have two view helper
module Admin::CategoriesHelper
def test
return "a"
end
module CategoriesHelper
def test
return "b"
end
i invoke test method in views/admin/categories/index.html.erb
====================================================================
if i use Admin::CategoriesHelper.test it will throw error like bellows:
NoMethodError in Admin/categories#index
Showing /home/mlzboy/my/b2c2/app/views/admin/categories/index.html.erb where line #32 raised:
undefined method `my_new_admin_category_path' for Admin::CategoriesHelper:Module
Extracted source (around line #32):
29:
30: <br />
31:
32: <%= link_to 'New Category', Admin::CategoriesHelper.my_new_admin_category_path(@parent) %>
it's return b
not a
if i change the method name like test2 didn't have the same with CategoriesHelper it's work fine
so how to resolve this problem,i newibe in rails,i want to know why this happen,thanks
is there something wrong with my routes.rb?,my routes.rb file is as bellows
namespace :admin do
resources :categories
end
resources :categories