so I have the following
# app/helpers/experts_helper.rb
module ExpertsHelper
....
def twitter_link(expert)
link_to expert.twitter_url, class: 'social-link', target: '_blank' do
content_tag(:i, '', class: 'fa fa-twitter expert-fa')
end
end
def linkedin_link(expert)
link_to expert.linkedin_url, class: 'social-link', target: '_blank' do
content_tag(:i, '', class: 'fa fa-linkedin expert-fa')
end
end
end
I can access these methods in all my views inside views/experts/...
but not in those inside views/admin/experts/...
How can I access these them? Thanks
EDIT 1:: Corrected some typos, also I want to be able to use these helper methods
on class Admin::ExpertsController < AdminController (content omitted for brevity) end
I have used include ExpertsHelper
inside the controller, but it doesn't solve it
EDIT 2: I have tried all proposed solutions but still don't get anything to be displayed.
I have tried the include ExpertsHelper
and the include ApplicationController.helpers.method
, with the latter I get TypeError - wrong argument type Array (expected Module):
and with the former I don't get any errors, but I don't see anything being displayed on the page, no icons, no photos, nothing. I even tried copying the helper methods inside module Experts
inside the module Experts::AdminHelper end
, but still nothing.