CSS issue with div fieldWithErrors

Fernando Perez
Thu, 01 Oct 2009 09:22:49 -0000

Hi,

What''s the correct way of writing a form?

I do the following:

<%= form_for ... %>

  <%= f.label :whatever %>
  <%= f.text_field :whatever %>

<%- end -%>

Then I do some CSS to have all the labels aligned, and all the input
fields aligned. The problem happens when a field is not valid, Rails
wraps it in this stupid div with class fieldWithErrors (and what the
hell is that camelCaseCrap?), so it blows my design out.

Is there somewhere some easy CSS to circumvent that trouble? Nothing
fancy, just a simple and clean form.