Skip to content
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

Highlight fields with errors & update validations. #222

Merged
merged 1 commit into from
Sep 4, 2014

Conversation

monfresh
Copy link
Member

@monfresh monfresh commented Sep 4, 2014

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.

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.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) when pulling d76d166 on 188-highlight-error-fields into bfc07ba on master.

monfresh added a commit that referenced this pull request Sep 4, 2014
Highlight fields with errors & update validations.
@monfresh monfresh merged commit 99a6735 into master Sep 4, 2014
@monfresh monfresh deleted the 188-highlight-error-fields branch September 4, 2014 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Admin: highlight fields with errors
2 participants