Show full error messages with simple form?

前端 未结 1 1398
别跟我提以往
别跟我提以往 2021-01-05 23:19

How do I output the full error message of a field using simple form? The equivalent of rails: <%= RESOURCE.errors.full_messages %>

e.g. show this:

1条回答
  •  情话喂你
    2021-01-05 23:44

    If anyone is still wondering there is an easy way to do this now, as referenced here

    Simply under config/initializers/simple_form.rb change b.user :error to b.user :full_error and now your error messages will be the equivalent of RESOURCE.errors.full_messages

    Note: if you are using bootstrap w/ simple form you change simple_form_bootstrap.rb

    0 讨论(0)
提交回复
热议问题