aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/active_model_helper.rb
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-11-09 13:10:52 -0500
committerGitHub <noreply@github.com>2017-11-09 13:10:52 -0500
commitdac7c8844b4d9944eaa0fca98b45ee478cdb7201 (patch)
tree7e807b5ddbaab46c4470f78d7866a854cffb8db9 /actionview/lib/action_view/helpers/active_model_helper.rb
parent5961d6882bc3a6aaa2b3735e7a8cbe3f2fb901af (diff)
parentead4776b82f838ee0630770d1852e8b02ac0f923 (diff)
downloadrails-dac7c8844b4d9944eaa0fca98b45ee478cdb7201.tar.gz
rails-dac7c8844b4d9944eaa0fca98b45ee478cdb7201.tar.bz2
rails-dac7c8844b4d9944eaa0fca98b45ee478cdb7201.zip
Merge pull request #31088 from neumayr/am-helper-missing-field_with_errors
field_error_proc wrap form select optgroup and separator option
Diffstat (limited to 'actionview/lib/action_view/helpers/active_model_helper.rb')
-rw-r--r--actionview/lib/action_view/helpers/active_model_helper.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/actionview/lib/action_view/helpers/active_model_helper.rb b/actionview/lib/action_view/helpers/active_model_helper.rb
index f1ef715710..e41a95d2ce 100644
--- a/actionview/lib/action_view/helpers/active_model_helper.rb
+++ b/actionview/lib/action_view/helpers/active_model_helper.rb
@@ -17,8 +17,8 @@ module ActionView
end
end
- def content_tag(*)
- error_wrapping(super)
+ def content_tag(type, options, *)
+ select_markup_helper?(type) ? super : error_wrapping(super)
end
def tag(type, options, *)
@@ -43,6 +43,10 @@ module ActionView
object.respond_to?(:errors) && object.errors.respond_to?(:[]) && error_message.present?
end
+ def select_markup_helper?(type)
+ ["optgroup", "option"].include?(type)
+ end
+
def tag_generate_errors?(options)
options["type"] != "hidden"
end