aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorStephen St. Martin <kuprishuz@gmail.com>2010-01-25 22:45:44 -0500
committerStefan Penner <stefan.penner@gmail.com>2010-01-27 12:44:34 -0600
commit8b7cd5ae7ef2d8072779d756281f440f19f9500d (patch)
treed65fd7c540e3f4bb7e7617b10d7413e6f5de1cab /actionpack
parent2204215b43d3dfe9e4a35785e8d4401b7f63ccbf (diff)
downloadrails-8b7cd5ae7ef2d8072779d756281f440f19f9500d.tar.gz
rails-8b7cd5ae7ef2d8072779d756281f440f19f9500d.tar.bz2
rails-8b7cd5ae7ef2d8072779d756281f440f19f9500d.zip
fix duplidate data-submit attribute, submit_to_remote should test url
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/ajax_helper.rb2
-rw-r--r--actionpack/test/template/ajax_helper_test.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/ajax_helper.rb b/actionpack/lib/action_view/helpers/ajax_helper.rb
index 1a396215fc..ae37802f02 100644
--- a/actionpack/lib/action_view/helpers/ajax_helper.rb
+++ b/actionpack/lib/action_view/helpers/ajax_helper.rb
@@ -361,7 +361,7 @@ module ActionView
attributes = extract_remote_attributes!(options)
attributes.merge!(html_options)
- attributes["data-submit"] = true
+ attributes["data-remote-submit"] = true
attributes.delete("data-remote")
tag(:input, attributes)
diff --git a/actionpack/test/template/ajax_helper_test.rb b/actionpack/test/template/ajax_helper_test.rb
index 2e46a38656..4a84ce47e0 100644
--- a/actionpack/test/template/ajax_helper_test.rb
+++ b/actionpack/test/template/ajax_helper_test.rb
@@ -267,8 +267,8 @@ class AjaxHelperTest < AjaxHelperBaseTest
end
test "submit_to_remote" do
- assert_dom_equal %(<input name=\"More beer!\" type=\"button\" value=\"1000000\" data-url=\"http://www.example.com/\" data-submit=\"true\" data-update-success=\"empty_bottle\" />),
- submit_to_remote("More beer!", 1_000_000, :update => "empty_bottle")
+ assert_dom_equal %(<input name=\"More beer!\" type=\"button\" value=\"1000000\" data-url=\"http://www.example.com/empty_bottle\" data-remote-submit=\"true\" data-update-success=\"empty_bottle\" />),
+ submit_to_remote("More beer!", 1_000_000, :url => { :action => 'empty_bottle' }, :update => "empty_bottle")
end
test "observe_field" do