aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-07-17 09:23:56 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-07-17 09:23:56 +0000
commit02c1dae551b5c1891423ce46a0e4d8b06048b60b (patch)
tree936808b0288f3c09b5591ddf7d09f8722d050601 /actionpack/lib/action_view
parentb66b1fff1211ca015bf80d9c105270f195cb8a44 (diff)
downloadrails-02c1dae551b5c1891423ce46a0e4d8b06048b60b.tar.gz
rails-02c1dae551b5c1891423ce46a0e4d8b06048b60b.tar.bz2
rails-02c1dae551b5c1891423ce46a0e4d8b06048b60b.zip
Docs for JavaScriptHelper#remote_function #1740 [jon@instance-design.co.uk]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1847 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/helpers/javascript_helper.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb
index 5f450e9e8f..76be539332 100644
--- a/actionpack/lib/action_view/helpers/javascript_helper.rb
+++ b/actionpack/lib/action_view/helpers/javascript_helper.rb
@@ -235,7 +235,15 @@ module ActionView
"eval(request.responseText)"
end
- def remote_function(options) #:nodoc: for now
+ # Returns the javascript needed for a remote function.
+ # Takes the same arguments as link_to_remote
+ #
+ # Example:
+ # <select id="options" onchange="<%= remote_function(:update => "options", :url => { :action => :update_options }) %>">
+ # <option value="0">Hello</option>
+ # <option value="1">World</option>
+ # </select>
+ def remote_function(options)
javascript_options = options_for_ajax(options)
update = ''