Rails makes it very easy to style fields with errors on your form. Unfortunately, the same error DIV with class ‘.field_with_errors’ is applied around labels, as well as inputs/checkboxes/selects. This tends to mess up the layout and double up on error display. To fix this, you can configure the field_error_proc in your application.rb to ignore labels. The code below calls the original error decoration proc for all types of tags except for labels.
Categories
- ALT.NET (14)
- Android (3)
- Book Reviews (28)
- Brewing (3)
- C# (37)
- Cloud (3)
- Design / Architecture (15)
- EDI (2)
- English (1)
- Fiction (9)
- Finance (3)
- Food and Drink (2)
- GetUp (4)
- Java (7)
- JavaScript (1)
- JRuby (8)
- Mephisto (5)
- Music (1)
- Personal (48)
- REST (7)
- RiskAssess (3)
- Ruby / Rails (60)
- Soft Skills and Mind Hacks (18)
- Talks (32)
- Technical (134)
- Testing (7)
- ThoughtWorks (10)
- Travel (5)
- Windows (3)
- Wing Chun (7)
- WPF (1)
- YourWeddingPresents.com (3)
Leave a Reply