aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/form_tag_helper.rb
diff options
context:
space:
mode:
authorDavid Lee <davidomundo@gmail.com>2011-05-13 17:54:29 -0700
committerDavid Lee <davidomundo@gmail.com>2011-06-11 01:58:26 -0700
commit91e3046b717117b4d2961b813fee674fdda2cb47 (patch)
treefa340084258689ba60710d359e178e7f0fdd3ad8 /actionpack/lib/action_view/helpers/form_tag_helper.rb
parentfa3fc520698092a002562107731b0d3b97e203d4 (diff)
downloadrails-91e3046b717117b4d2961b813fee674fdda2cb47.tar.gz
rails-91e3046b717117b4d2961b813fee674fdda2cb47.tar.bz2
rails-91e3046b717117b4d2961b813fee674fdda2cb47.zip
Make utf8_enforcer_tag an overrideable method
Diffstat (limited to 'actionpack/lib/action_view/helpers/form_tag_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/form_tag_helper.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb
index dcc96c0168..dd19fd2de9 100644
--- a/actionpack/lib/action_view/helpers/form_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb
@@ -604,6 +604,13 @@ module ActionView
number_field_tag(name, value, options.stringify_keys.update("type" => "range"))
end
+ # Creates the hidden UTF8 enforcer tag. Override this method in a helper
+ # to customize the tag. If you just need to change the field name, set the
+ # +config.action_view.utf8_enforcer_param+ configuration option instead.
+ def utf8_enforcer_tag
+ tag(:input, :type => "hidden", :name => utf8_enforcer_param, :value => "&#x2713;".html_safe)
+ end
+
private
def html_options_for_form(url_for_options, options, *parameters_for_url)
options.stringify_keys.tap do |html_options|
@@ -618,9 +625,6 @@ module ActionView
end
def extra_tags_for_form(html_options)
- utf8_enforcer_tag = tag(:input, :type => "hidden",
- :name => utf8_enforcer_param, :value => "&#x2713;".html_safe)
-
authenticity_token = html_options.delete("authenticity_token")
method = html_options.delete("method").to_s