Permalink
Browse files

make observers a little more dry

  • Loading branch information...
1 parent 49e84a5 commit f115fb011169cadfd1977c7e6d6ddef2eecc96de @stevestmartin stevestmartin committed with stefanpenner Jan 23, 2010
Showing with 1 addition and 2 deletions.
  1. +1 −2 actionpack/lib/action_view/helpers/ajax_helper.rb
@@ -60,15 +60,13 @@ def periodically_call_remote(options = {})
def observe_field(name, options = {})
options[:observed] = name
attributes = extract_observer_attributes!(options)
- attributes["data-observe"] = true
script_decorator(attributes)
end
def observe_form(name, options = {})
options[:observed] = name
attributes = extract_observer_attributes!(options)
- attributes["data-js-type"] = "form_observer"
script_decorator(attributes)
end
@@ -130,6 +128,7 @@ def extract_update_attributes!(options)
def extract_observer_attributes!(options)
attributes = extract_remote_attributes!(options)
+ attributes["data-observe"] = true
attributes["data-observed"] = options.delete(:observed)
callback = options.delete(:function)

0 comments on commit f115fb0

Please sign in to comment.