I am confused about the rails Helper scope.
I defined a testpage method in PagesHelper
module PagesHelper
def testpage
"testpagehelper"
end
end
But why I can use the testpage method in views/users/index.html.erb
<h1><%= testpage %> </h1>
I suppose the testpage only used in views/pages/index.html.erb?
I think the helper method scope is too broad.
And there is a problem if I defined the same method in the UsersHelper.
module UsersHelper
def testpage
"testuserhelper"
end
end
there is two testpage in the helper,but the resutl is the view/pages/index.html and the view/users/index.html all use the "testpage" in the UsersHelper?Why?