Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 4838

Show
Ignore:
Timestamp:
08/29/06 07:48:55 (2 years ago)
Author:
david
Message:

Keep onsubmit around for form_remote_for

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_view/helpers/prototype_helper.rb

    r4836 r4838  
    170170 
    171171        options[:html] ||= {} 
    172         options[:html][:onsubmit] = "#{remote_function(options)}; return false;" 
     172        options[:html][:onsubmit] =  
     173          (options[:html][:onsubmit] ? options[:html][:onsubmit] + "; " : "") +  
     174          "#{remote_function(options)}; return false;" 
    173175 
    174176        form_tag(options[:html].delete(:action) || url_for(options[:url]), options[:html]) 
     
    294296 
    295297        update = '' 
    296         if options[:update] and options[:update].is_a?Hash 
     298        if options[:update] && options[:update].is_a?(Hash) 
    297299          update  = [] 
    298300          update << "success:'#{options[:update][:success]}'" if options[:update][:success] 
     
    308310 
    309311        url_options = options[:url] 
    310         url_options = url_options.merge(:escape => false) if url_options.is_a? Hash 
     312        url_options = url_options.merge(:escape => false) if url_options.is_a?(Hash) 
    311313        function << "'#{url_for(url_options)}'" 
    312314        function << ", #{javascript_options})"