Skip to content

Instantly share code, notes, and snippets.

@jcrisp
Created September 23, 2020 06:30
Show Gist options
  • Save jcrisp/42ad8778a7388c21c495d11788b0ab27 to your computer and use it in GitHub Desktop.
Save jcrisp/42ad8778a7388c21c495d11788b0ab27 to your computer and use it in GitHub Desktop.
class Application < Rails::Application
# ... other config ...
# no error div on labels
add_error_div_proc = ActionView::Base.field_error_proc
config.action_view.field_error_proc = ->(html_tag, instance) {
html_tag && html_tag.start_with?("<label") ? html_tag : add_error_div_proc.call(html_tag, instance) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment