Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rename _snowman_ to _snowman to be in sync with _method and _csrf_token.

  • Loading branch information...
commit caab17611668ff18a3c8642b2d45b353be5d9691 1 parent dabf74b
@josevalim josevalim authored
View
2  actionpack/lib/action_view/helpers/form_tag_helper.rb
@@ -537,7 +537,7 @@ def html_options_for_form(url_for_options, options, *parameters_for_url)
def extra_tags_for_form(html_options)
snowman_tag = tag(:input, :type => "hidden",
- :name => "_snowman_", :value => "☃")
+ :name => "_snowman", :value => "☃")
method = html_options.delete("method").to_s
View
2  actionpack/test/template/form_helper_test.rb
@@ -1484,7 +1484,7 @@ def test_form_for_with_labelled_builder
def snowman(method = nil)
txt = %{<div style="margin:0;padding:0;display:inline">}
- txt << %{<input name="_snowman_" type="hidden" value="&#9731;" />}
+ txt << %{<input name="_snowman" type="hidden" value="&#9731;" />}
txt << %{<input name="_method" type="hidden" value="#{method}" />} if method
txt << %{</div>}
end
View
2  actionpack/test/template/form_tag_helper_test.rb
@@ -12,7 +12,7 @@ def snowman(options = {})
method = options[:method]
txt = %{<div style="margin:0;padding:0;display:inline">}
- txt << %{<input name="_snowman_" type="hidden" value="&#9731;" />}
+ txt << %{<input name="_snowman" type="hidden" value="&#9731;" />}
txt << %{<input name="_method" type="hidden" value="#{method}" />} if method
txt << %{</div>}
end

3 comments on commit caab176

@jdalton

Isn't it like technically uncool to start names or ids with an underscore?
http://www.w3.org/TR/html401/types.html#type-name

@stephenorr

Better that than potentially having conflicts with people's real form variables :)

@jdalton

Naw just stick the underscore at the end snowman_ or prefix / append it with something rails_snowman or snowman_rails or something :D

Please sign in to comment.
Something went wrong with that request. Please try again.