From 779094a6024c762b3dfb60db7efb1d5d7f0c4ddc Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sat, 30 Jan 2010 15:28:31 -0600 Subject: Move button_to_remote and submit_to_remote into prototype_legacy_helper plugin --- .../lib/action_view/helpers/prototype_helper.rb | 38 ---------------------- 1 file changed, 38 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb index 56a7198792..818412c345 100644 --- a/actionpack/lib/action_view/helpers/prototype_helper.rb +++ b/actionpack/lib/action_view/helpers/prototype_helper.rb @@ -102,14 +102,6 @@ module ActionView :form, :with, :update, :script, :type ]).merge(CALLBACKS) end - # Creates a button with an onclick event which calls a remote action - # via XMLHttpRequest - # The options for specifying the target with :url - # and defining callbacks is the same as link_to_remote. - def button_to_remote(name, options = {}, html_options = {}) - button_to_function(name, remote_function(options), html_options) - end - # Returns a form tag that will submit using XMLHttpRequest in the # background instead of the regular reloading POST arrangement. Even # though it's using JavaScript to serialize the form elements, the form @@ -212,36 +204,6 @@ module ActionView end alias_method :form_remote_for, :remote_form_for - # Returns a button input tag with the element name of +name+ and a value (i.e., display text) of +value+ - # that will submit form using XMLHttpRequest in the background instead of a regular POST request that - # reloads the page. - # - # # Create a button that submits to the create action - # # - # # Generates: - # <%= submit_to_remote 'create_btn', 'Create', :url => { :action => 'create' } %> - # - # # Submit to the remote action update and update the DIV succeed or fail based - # # on the success or failure of the request - # # - # # Generates: - # <%= submit_to_remote 'update_btn', 'Update', :url => { :action => 'update' }, - # :update => { :success => "succeed", :failure => "fail" } - # - # options argument is the same as in form_remote_tag. - def submit_to_remote(name, value, options = {}) - options[:with] ||= 'Form.serialize(this.form)' - - html_options = options.delete(:html) || {} - html_options[:name] = name - - button_to_remote(value, options, html_options) - end - # Returns 'eval(request.responseText)' which is the JavaScript function # that +form_remote_tag+ can call in :complete to evaluate a multiple # update return document using +update_element_function+ calls. -- cgit v1.2.3