Where to find documentation on how to design (rails 3) helpers

I may be blind, but I cannot find good documentation on how to write helpers for your own views in rails 3. The answers I am looking for are the following:

I have a partial view (say shared / _error_messages.html) where his assistant should be, what should I call him, what are the conventions? How to pass local variables from view to helper and vice versa?

Yeap, so let's say the basics ... Thanks in advance

+3
source share
1 answer

Extract the method from _error_messages.html.erb to helpers / application_helper.html.erb, this is a global helper, which means that the methods are available throughout the project.

<%= render :partial => "shared/error_messages" %> 

.

+2

Source: https://habr.com/ru/post/1776655/


All Articles