if you want it to be available from anywhere, put it in helpers/
application_helper.rb
On Aug 1, 5:39 pm, skibud2
<mike.hallo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I am trying to make a shared helper. I have searched near and far for
> every piece of help, yet I am still stuck. I am assuming it should be
> quite easy; I guess just not for me.
>
> # helpers/fun_helper.rb -- Note: this works fine from the
> fun_controller
> module FunHelper
> def test_foo2
> "test"
> end
> end
>
> # test_controller.rb
> class TestController < ApplicationController
> helper :fun
> end
>
> # views/test/index.rhtml
> <html>
> <body>
> <%= test_foo2 %>
> </body>
> </html>
>
> I am getting the following error:
>
> >> undefined local variable or method `test_foo2'' for ...
>
> Thank you,
>
> Mike
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---