Created
October 28, 2011 16:16
-
-
Save jperrine/1322659 to your computer and use it in GitHub Desktop.
ignore field name in errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in your model | |
def self.full_message_fields | |
[:field1, :field2] # these fields will display the full message | |
end | |
# inside your form | |
-if @group.errors.any? | |
#error_explanation | |
%ul | |
- @group.errors.each do |attr, msg| | |
- if @group.class.full_message_fields.include? attr | |
%li= "#{attr} #{msg}" | |
- else | |
%li= msg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment