I have two Helpers
, ExamsHelper
and ResultsHelper
exams_helper.rb
module ExamsHelper
def get_data
...
end
end
results_helper.rb
module ResultsHelper
def find_result
...
end
end
Is it possible to access the get_data
method in ResultsHelper
.
I know that if I am declaring it on the ApplicationHelper
, I can access it. Is there any other solution for it?
You can always use include
:
module ResultsHelper
include ExamsHelper
def find_result
get_data # works
end
end
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.