How to Show Error Messages Next to Field

后端 未结 4 608
花落未央
花落未央 2020-12-13 19:16

I have a form with input fields/labels etc. How do I get the error message to show up next to the field? instead of clumped together at the top?

I am using devise, r

4条回答
  •  鱼传尺愫
    2020-12-13 19:47

    You can use error_message_on http://apidock.com/rails/ActionView/Helpers/ActiveRecordHelper/error_message_on

    Update:

    form.error_messages was removed from Rails and is now available as a plugin. Please install it with rails plugin install git://github.com/rails/dynamic_form.git.

提交回复
热议问题