When the appearance of the input form is broken on the page after rendering

Version you are using

Ruby ver. 2.6.5 Rails ver. 6.0.3.4

phenomenon

After the post input form was rendered due to a typo, the shape collapsed ↓ スクリーンショット 2020-12-14 20.56.11.png

スクリーンショット 2020-12-08 18.48.25.png

Solution

It was solved by writing the following in the CSS file.

post.css


.field_with_errors {
  display: contents;
}

In Rails, the field containing the error message is automatically surrounded by a div tag with the field_with_errors class, which seems to break the layout.

Recommended Posts

When the appearance of the input form is broken on the page after rendering
How to display the result of form input
When the hover of Eclipse is hard to see
When the month of the date is acquired, the January shift
The idea of cutting off when the error is not resolved
Delete all the contents of the list page [Ruby on Rails]
[Rails] When the layout change of devise is not reflected
[Swift] Get the timing when the value of textField is changed
I want to make the frame of the text box red when there is an input error
How to display 0 on the left side of the standard input value
When the processing after conditional branching is redundant-12 [C # refactoring sample]
Change the conversation depending on which day of the week is today
Investigation method when the CPU of the server running java is heavy