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

Ticket #7904: prototype_helper.with_degradation.diff

File prototype_helper.with_degradation.diff, 0.7 kB (added by chuyeow, 2 years ago)

Diff that patches link_to_remote in prototype_helper.rb to be degradable in non-JS browsers

  • prototype_helper.rb

    old new  
    129129      #                          default this is the current form, but 
    130130      #                          it could just as well be the ID of a 
    131131      #                          table row or any other DOM element. 
    132       def link_to_remote(name, options = {}, html_options = {})   
     132      def link_to_remote(name, options = {}, html_options = {}) 
     133        html_options[:href] = url_for(options[:url]) if !html_options.has_key?(:href) 
    133134        link_to_function(name, remote_function(options), html_options) 
    134135      end 
    135136