Permalink
Browse files

removing generation of id in submit helper

[#6369 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
  • Loading branch information...
1 parent 23a3ba4 commit d3cfee118245a8806436bbf904bbad36dd810012 @fbrusatti fbrusatti committed with spastorino Feb 3, 2011
View
2 actionpack/lib/action_view/helpers/form_helper.rb
@@ -1243,7 +1243,7 @@ def file_field(method, options = {})
def submit(value=nil, options={})
value, options = nil, value if value.is_a?(Hash)
value ||= submit_default_value
- @template.submit_tag(value, options.reverse_merge(:id => "#{object_name}_submit"))
+ @template.submit_tag(value, options)
end
def emitted_hidden_id?
View
12 actionpack/test/template/form_helper_test.rb
@@ -630,7 +630,7 @@ def test_form_for
"<textarea name='post[body]' id='post_body' rows='20' cols='40'>Back to the hill and over it again!</textarea>" +
"<input name='post[secret]' type='hidden' value='0' />" +
"<input name='post[secret]' checked='checked' type='checkbox' id='post_secret' value='1' />" +
- "<input name='commit' id='post_submit' type='submit' value='Create post' />"
+ "<input name='commit' type='submit' value='Create post' />"
end
assert_dom_equal expected, output_buffer
@@ -709,7 +709,7 @@ def test_form_for_with_symbol_object_name
"<textarea name='other_name[body]' id='other_name_body' rows='20' cols='40'>Back to the hill and over it again!</textarea>" +
"<input name='other_name[secret]' value='0' type='hidden' />" +
"<input name='other_name[secret]' checked='checked' id='other_name_secret' value='1' type='checkbox' />" +
- "<input name='commit' id='other_name_submit' value='Create post' type='submit' />"
+ "<input name='commit' value='Create post' type='submit' />"
end
assert_dom_equal expected, output_buffer
@@ -843,7 +843,7 @@ def test_submit_with_object_as_new_record_and_locale_strings
end
expected = whole_form('/posts', 'new_post', 'new_post') do
- "<input name='commit' id='post_submit' type='submit' value='Create Post' />"
+ "<input name='commit' type='submit' value='Create Post' />"
end
assert_dom_equal expected, output_buffer
@@ -859,7 +859,7 @@ def test_submit_with_object_as_existing_record_and_locale_strings
end
expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'put') do
- "<input name='commit' id='post_submit' type='submit' value='Confirm Post changes' />"
+ "<input name='commit' type='submit' value='Confirm Post changes' />"
end
assert_dom_equal expected, output_buffer
@@ -875,7 +875,7 @@ def test_submit_without_object_and_locale_strings
end
expected = whole_form do
- "<input name='commit' class='extra' id='post_submit' type='submit' value='Save changes' />"
+ "<input name='commit' class='extra' type='submit' value='Save changes' />"
end
assert_dom_equal expected, output_buffer
@@ -891,7 +891,7 @@ def test_submit_with_object_and_nested_lookup
end
expected = whole_form('/posts/123', 'another_post_edit', 'another_post_edit', :method => 'put') do
- "<input name='commit' id='another_post_submit' type='submit' value='Update your Post' />"
+ "<input name='commit' type='submit' value='Update your Post' />"
end
assert_dom_equal expected, output_buffer

11 comments on commit d3cfee1

@divins

What is the motivation of this change? Could not find any explanation at Lighthouse (https://rails.lighthouseapp.com/projects/8994/tickets/6369)

@spastorino
Ruby on Rails member

Why do you need this helper to autogenerate ids for submit inputs?

@fbrusatti
@guilleiguaran
Ruby on Rails member

@fbrusatti I think @spastorino is asking to @divins, not to you ;)

@spastorino
Ruby on Rails member

hahaha, yeah I'm asking @divins

@fbrusatti

@all hahaha sorry :P. I just answer from my email and I didn't realize of the new comment :P (dhoo sorry)

@oriolgual

@spastorino we relied on it to generate the id and just were surprised when upgrading to 3.1 cc "divins

@spastorino
Ruby on Rails member

@oriolgual you can customize it at your own now ;)

@vijaydev
Ruby on Rails member

@spastorino: I think it will be nice to have a changelog entry for this.

@spastorino
Ruby on Rails member

@vijaydev we don't have an entry already? can you provide one?

@vijaydev
Ruby on Rails member

Yeah, I wasn't able to find an entry. Here is a PR: #2155

Please sign in to comment.