Using helpers from gems

10 views
Skip to first unread message

John Lane

unread,
May 13, 2014, 12:21:59 PM5/13/14
to cells-an...@googlegroups.com
Hi Nick, I hope you don't mind another question...?

I added a gem (font-awesome-rails) to my app that provides some helpers (I know how you feel about helpers!) but they aren't automatically available to widget views (they work fine in controller views so they are definately there). I have it working by doing the below in my widget controller:

include FontAwesome::Rails::IconHelper
helper_method :fa_icon, :fa_stacked_icon

This makes the helper "fa_icon" and "fa_stacked_icon" usable from the widget's view.

I just thought I'd ask whether this is correct or if I am missing something.

Cheers,
John
Reply all
Reply to author
Forward
0 new messages