Reputation: 4012
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?
Upvotes: 0
Views: 515
Reputation: 51151
You can always use include
:
module ResultsHelper
include ExamsHelper
def find_result
get_data # works
end
end
Upvotes: 3