Permalink
Browse files

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
  • Loading branch information...
1 parent b66b1ff commit 02c1dae551b5c1891423ce46a0e4d8b06048b60b @dhh dhh committed Jul 17, 2005
Showing with 9 additions and 1 deletion.
  1. +9 −1 actionpack/lib/action_view/helpers/javascript_helper.rb
@@ -235,7 +235,15 @@ def evaluate_remote_response
"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 = ''

0 comments on commit 02c1dae

Please sign in to comment.