diff options
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/javascript_helper.rb | 10 |
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 = '' |