On Sun, Oct 9, 2011 at 9:09 AM, Shanison <lxsh...@gmail.com> wrote:
> Hi all,
>
> I have some methods that needs to be used by all helpers in the
> extensions. So I need to add some methods to ApplicationHelper. I
> can't just create the application_helper.rb in my extensions, it will
> just overwrite the application_helper in radiant and only my own
> methods in the application_helper.rb is visible.
>
> I tried to do ApplicationHelper.send(:include,
> MyExtensions::ApplicationHelperExtensions) when activating the
> extension. However, those methods in ApplicationHelperExtensions are
> also not visible to my helpers. I tried to use rails console and do
> ApplicationHelper.instance_methods.include?('my_method_name')
>
> It returns true. I don't understand why my helpers are not able to
> pick up those methods. Any help is appreciated. Thanks.
>

I don't think you need to extend the ApplicationHelper, you just need
to include a new helper into ApplicationController

Does this example from the Help extension work for you?
https://github.com/saturnflyer/radiant-help-extension/blob/master/help_extension.rb#L53



-- 
OOP, DCI, and Ruby
http://www.saturnflyer.com/blog/jim/2011/10/04/oop-dci-and-ruby-what-your-system-is-vs-what-your-system-does/

Jim Gay
Saturn Flyer LLC
http://www.saturnflyer.com
571-403-0338

Reply via email to