Skip to content

Instantly share code, notes, and snippets.

@dustMason
Forked from t2/application.rb
Last active December 18, 2015 17:19
Show Gist options
  • Save dustMason/5817510 to your computer and use it in GitHub Desktop.
Save dustMason/5817510 to your computer and use it in GitHub Desktop.
Rails 3 ActionView override for Foundation 4 field error styles.
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
%(<div class="error">#{html_tag}<small>#{instance.error_message.to_a.to_sentence}</small></div>).html_safe
end
@dustMason
Copy link
Author

Note that this wraps labels and inputs in their own <div>'s. This is fine for my project, YMMV

@tough-griff
Copy link

This helped me out a bunch, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment