Enhance documentation for observe_field. Closes #9808 [RubyRedRick, danger]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7901 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Michael Koziarski 2007-10-15 05:03:23 +00:00
parent 2e2ce1f6c9
commit 61639262f1
1 changed files with 10 additions and 1 deletions

View File

@ -315,7 +315,16 @@ module ActionView
# <tt>:url</tt>:: +url_for+-style options for the action to call
# when the field has changed.
# <tt>:function</tt>:: Instead of making a remote call to a URL, you
# can specify a function to be called instead.
# can specify javascript code to be called instead.
# Note that the value of this option is used as the
# *body* of the javascript function, a function definition
# with parameters named element and value will be generated for you
# for example:
# observe_field("glass", :frequency => 1, :function => "alert('Element changed')")
# will generate:
# new Form.Element.Observer('glass', 1, function(element, value) {alert('Element changed')})
# The element parameter is the DOM element being observed, and the value is its value at the
# time the observer is triggered.
#
# Additional options are:
# <tt>:frequency</tt>:: The frequency (in seconds) at which changes to