You should override ActionView::Base.field_error_proc
. It's currently defined as this within ActionView::Base
:
@@field_error_proc = Proc.new{ |html_tag, instance|
"<div class="field_with_errors">#{html_tag}</div>".html_safe
}
You can override it by putting this in your application's class inside config/application.rb
:
config.action_view.field_error_proc = Proc.new { |html_tag, instance|
html_tag
}
Restart rails server for this change to take effect.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…