method

build_observer

rails latest stable - Class: ActionView::Helpers::JavaScriptHelper

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v1.0.0) is shown here.

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