[Rails] Workaround for classes automatically generated by devise error messages

problem

When implementing a login form using devise, ** error message ** can be displayed, but when the error message is displayed, as shown in the image below, A class called div class =" field_with_errors " is automatically generated and the view collapses.

image.png

approach

The solution is pretty simple, just specify display: contents in css as below!

.css


.field_with_errors {
  display: contents
}

Finally

This is an error that beginners may encounter, so I hope you can refer to it!

Recommended Posts

[Rails] Workaround for classes automatically generated by devise error messages
Testing for Error Messages: Rails Tutorial Notes-Chapter 7
The road to Japaneseizing Rails devise error messages
Japaneseization of Rails error messages [devise / Form objects, etc.]
(For beginners) [Rails] Install Devise
[rails] error during devise installation
[Rails] How to display error messages for comment function (for beginners)
[Rails] Japanese localization of error messages
[Rails] Unexpected validation error in devise
[Rails] Display form error messages asynchronously
Workaround for Xcode 12 "Double-quoted include" error
Japanese localization of error messages (rails)
[Rails] How to display error messages individually
[Ruby / Rails] Mechanism for retrying Thread Error
[Rails6] How to connect the posting function generated by Scaffold with the user function generated by devise