Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

periodically_call_remote does not need data-observe=true

  • Loading branch information...
commit 0215466832faddd2fc5ebef9500f06fa1b95228e 1 parent 6a8da20
Erik St. Martin erikstmartin authored stefanpenner committed
3  actionpack/lib/action_view/helpers/ajax_helper.rb
View
@@ -402,6 +402,9 @@ def periodically_call_remote(options = {})
attributes = extract_observer_attributes!(options)
attributes["data-periodical"] = true
+ # periodically_call_remote does not need data-observe=true
+ attributes.delete('data-observe')
+
script_decorator(attributes)
end
4 actionpack/test/template/ajax_helper_test.rb
View
@@ -160,13 +160,13 @@ def setup
end
test "periodically_call_remote" do
- assert_dom_equal %(<script data-url=\"http://www.example.com/mehr_bier\" data-observe=\"true\" data-update-success=\"schremser_bier\" type=\"application/json\" data-periodical=\"true\"></script>),
+ assert_dom_equal %(<script data-url=\"http://www.example.com/mehr_bier\" data-update-success=\"schremser_bier\" type=\"application/json\" data-periodical=\"true\"></script>),
periodically_call_remote(:update => "schremser_bier", :url => { :action => "mehr_bier" })
end
test "periodically_call_remote_with_frequency" do
assert_dom_equal(
- "<script data-periodical=\"true\" data-url=\"http://www.example.com/\" data-observe=\"true\" type=\"application/json\" data-frequency=\"2\"></script>",
+ "<script data-periodical=\"true\" data-url=\"http://www.example.com/\" type=\"application/json\" data-frequency=\"2\"></script>",
periodically_call_remote(:frequency => 2)
)
end
Please sign in to comment.
Something went wrong with that request. Please try again.