Hi --
i have:
# file application_helper.rb module ApplicationHelper def load_components @right_sidebar = 'some stuffs' end end
# file user_public/blog_helper.rb module UserPublic::BlogHelper def load_components ApplicationHelper.load_components @right_sidebar += '{blog archive}' end end
the problem is, i want to load the ApplicationHelper.load_components method from the BlogHelper.load_components method -- but apperently the application helper is not the root of the blog helper. so how can i access it?
You can use 'super':
module UserPublic::BlogHelper def load_components super @right_sidebar += '{blog archive}' end end
super searches the object's method lookup-path for the next-found method with the same one as the one that's being executed. In this case, it will find the load_components defined in ApplicationHelper.
David