I may be blind but I can’t really find any good documentation on how to write helpers for your own views in rails 3.
The kind of answers I’m looking for is:
I have a partial view (say shared/_error_messages.html), where should its helper go, how should I name it, which are the conventions?
How to pass local variables from the view to the helper and vice-versa?
Yeap, so let’s say from the basics…
Thanks in advance
Extract the method from _error_messages.html.erb to helpers/application_helper.html.erb, this is a global helper, which means the methods there are available in the whole project.
You could leave it as a partial and load it with
as well.