protected Method

PrototypeHelper.build_observer(klass, name, options = {})

There's no documentation for this item.

Source Code

# File action_view/helpers/prototype_helper.rb, line 1038
def build_observer(klass, name, options = {})
  if options[:with] && (options[:with] !~ /[\{=(.]/)
    options[:with] = "'#{options[:with]}=' + value"
  else
    options[:with] ||= 'value' unless options[:function]
  end

  callback = options[:function] || remote_function(options)
  javascript  = "new #{klass}('#{name}', "
  javascript << "#{options[:frequency]}, " if options[:frequency]
  javascript << "function(element, value) {"
  javascript << "#{callback}}"
  javascript << ", '#{options[:on]}'" if options[:on]
  javascript << ")"
  javascript_tag(javascript)
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.