By default Rails wraps form errors in a div with the class field_with_errors
.
There are 2 ways to disable this.
First way is in the application.rb
environment file (doesn't make sense just to disable it on a specific environment?):
# config/application.rb
module ApplicationName
class Application < Rails::Application
config.action_view.field_error_proc = Proc.new do |html_tag, _instance|
html_tag.html_safe
end
end
end
The second way is to disable it in an initializer:
# config/intializers/action_view_intializer.rb or whatever you want to call this initializer ¯\_(ツ)_/¯
ActionView::Base.field_error_proc = Proc.new do |html_tag, _instance|
html_tag.html_safe
end