How are ruby ​​error messages displayed on rails?

Hey. I would like to understand how ruby ​​on rails error messages are displayed, more importantly, how the order in which error messages are displayed on the page is determined.

Thank you for your time.

+3
source share
2 answers

The most common way to display errors is to use an auxiliary error_messages:

<%= f.error_messages %>

, html- , @my_object.errors. - , , ( , ). .

error_messages - , , .

+2

Active Record . , . . .

, , , . . CleverValidation CustomErrorMessage...

, , , .

+1

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


All Articles