method
build_observer
rails latest stable - Class:
ActionView::Helpers::JavaScriptHelper
build_observer(klass, name, options = {})private
No documentation available.
# File actionpack/lib/action_view/helpers/javascript_helper.rb, line 503
def build_observer(klass, name, options = {})
options[:with] ||= 'value' if options[:update]
callback = remote_function(options)
javascript = "new #{klass}('#{name}', "
javascript << "#{options[:frequency]}, " if options[:frequency]
javascript << "function(element, value) {"
javascript << "#{callback}})"
javascript_tag(javascript)
end