I have two people_controller and people_helper. One in the controller
and helper directory and the other in the controller/admin and helper/
admin namespace. The reason I have two controllers is because I want
different views and functionality based on wether the user is an admin
or not. I know how to distinguish calling the controllers, but I
don’t know how to distinguish the helpers. To include the people
helper I use;
helper :people
How do I include the helper in the admin directory?
By the way, is there a difference between;
helper :people
and
include PeopleHelper
??
Franz Obenhauser wrote:
I have two people_controller and people_helper. One in the controller
and helper directory and the other in the controller/admin and helper/
admin namespace. The reason I have two controllers is because I want
different views and functionality based on wether the user is an admin
or not. I know how to distinguish calling the controllers,
i couldn’t understand you question
what you told that
“I know how to distinguish calling the controllers”
if you can then how ?
but I don’t know how to distinguish the helpers. To include the people
helper I use;
helper :people
How do I include the helper in the admin directory?
try this
helper ‘admin/people’
or
helper ‘admin::people’
Franz Obenhauser wrote:
By the way, is there a difference between;
helper :people
and
include PeopleHelper
??
yes – both are different
first one do both ruby magic require & include
second one do include only