diff options
author | Franco Brusatti <fbrusatti@gmail.com> | 2011-02-03 19:14:10 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-02-03 20:24:14 -0200 |
commit | d3cfee118245a8806436bbf904bbad36dd810012 (patch) | |
tree | 0888cd4ca60fac0e2cf7166e3877647bd805f86c /actionpack | |
parent | 23a3ba426067d3d38259ef4e1d234cbb82c8aea2 (diff) | |
download | rails-d3cfee118245a8806436bbf904bbad36dd810012.tar.gz rails-d3cfee118245a8806436bbf904bbad36dd810012.tar.bz2 rails-d3cfee118245a8806436bbf904bbad36dd810012.zip |
removing generation of id in submit helper
[#6369 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_helper.rb | 2 | ||||
-rw-r--r-- | actionpack/test/template/form_helper_test.rb | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index d7b9e0b4f4..d6edef0d34 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -1243,7 +1243,7 @@ module ActionView 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? diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index 2c60096475..e27ed20b81 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -630,7 +630,7 @@ class FormHelperTest < ActionView::TestCase "<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 @@ class FormHelperTest < ActionView::TestCase "<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 @@ class FormHelperTest < ActionView::TestCase 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 @@ class FormHelperTest < ActionView::TestCase 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 @@ class FormHelperTest < ActionView::TestCase 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 @@ class FormHelperTest < ActionView::TestCase 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 |