Form fields causing line breaks when there are errors

I have a minor problem. I have your basic ‘new’ method in my web
application where you fill out some form fields and click the ‘create’
button to submit a new entry in the database in the associated table. I
implemented validation in my model (validates_presence_of, etc.) so that
select fields are not left blank. One of my form fields are radio
buttons. When select fields are blank (those ones I explicitly say I do
not want left blank) I get rails error message:

4 errors prohibited this form from being saved

There were problems with the following fields:

* attribute1 can't be blank
* attribute2 can't be blank

I have no problem with this error. It’s fine as it is. However, my
problem is that when I reach this point where it displays error
messages, line breaks occur where I do not want them to. One example in
particular is my radio buttons.

They are in this form originally:

O option1
O option2
O option3

After the error messages are displayed lines start breaking like so:

O
option1
O
option2
O
option3

This is probably due to how it highlights the form fields affected, red.
I actually commented out all css styling associated with the error
messages, but solved nothing. Is there a solution to this problem?
Thanks.

-Gilles

Gilles wrote:

I actually commented out all css styling associated with the error
messages, but solved nothing. Is there a solution to this problem?
Thanks.

.fieldWithErrors { display: inline }

should work.


We develop, watch us RoR, in numbers too big to ignore.