-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Admin: highlight fields with errors #188
Comments
Has this been closed out? The admin forms appear to have red highlighting when ever I type in bogus entries on local host (8080). |
I don't think this has been fixed yet. I think what you're seeing is the browser's validation. For example, by identifying email fields as |
@monfresh you are correct - I'll keep plugging away. Thanks! |
Closes #188. Rails automatically surrounds a field that failed to pass validations with a div that has a class called `field_with_errors`. For some reason, this doesn’t get added to serialized fields, so I had to write custom methods in `form_helper.rb`. I also updated the HTML for some of the fields so that the highlighted field would retain the same appearance as the regular field. While working on this, I realized some of the model validations could be refactored and simplified.
Currently, if a validation error occurs, the error messages are displayed in a red box at the top of the page, but the affected fields themselves are not easy to spot. It would be nice to add a thick red (or other) border around the field with errors. Rails automatically adds a div around the affected fields with a class called "field_with_errors", so it should just be a matter of adding styles for that class.
The text was updated successfully, but these errors were encountered: