You don''t really need to add the function to ActionView::Helpers - all
you need to do is either put it in your
/app/helpers/application_helper.rb file, and the method will be
automatically made available to all your views.
Alternatively, define the method in a module, say, /lib/foo_helper.rb:
module FooHelper
def foo_tag
...
end
end
and then include this module in your ApplicationHelper:
module ApplicationHelper
include FooHelper
end
On 11/5/05, Pete <pertl-BA+cFGlbTmA@public.gmane.org>
wrote:> Hi #{pluralize(person)},
>
> Does some know how to add custom tag helpers to ActionView?
>
> Something like:
>
> module ActionView::Helpers::FooHelper
> def foo_tag
> "<foo bar=4711/>"
> end
> # ...
> end
>
>
> so you can use foo_tag inside an .rhtml like:
>
> ...
>
> <%= foo_tag %>
>
> ...
>
> Thanks in advance!!
>
> Regards
> Peter
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>