L-exp Mobile

Improving the accesibility of link_to_remote

It is very ease make link_to_remote accessible, it is, forcing it has a href value different than #, which is the default value if you only indicate the :url parameter.

But, it is quite possible that both parameters have the same value. If so, you can redefine link_to_remote in this way:

module ActionView module Helpers module PrototypeHelper def link_to_remote(name, options = {}, html_options = {}) html_options[:href] = options[:url] unless html_options[:href] link_to_function(name, remote_function(options), html_options) end end end end

Options:   Save This | Share
Viewed 0 times
Published 3 months ago
By
From Resource Inwebwetrust : Fernando Blat in lists:
Conferencia Rails Hispana '07

Menu

by Genís