After looking at the link_to_remote tag for the first time, I found it
broke when javascript was disabled.
Below is one possible solution I found and would like to suggest that
this idea is promoted into rails.
#
# provide fix for link_to_remote tag when javascript is not enabled
def link_to_remote_fix(text, options)
link_to_remote text, options, :href => url_for( options[:url] )
end
Your method is correct, you could however alias link_to_remote to
old_link_to_remote and then override the link_to_remote method. This
way, all your existing code will benefit from it. Keep in mind that
you need to provide seperate normal pages for each action you call
via link_to_remote so that it will render if Javascript is disabled.
I think it’s a good idea, but maybe as an option. A lot of the time
you don’t want your link_to_remote to actually get triggered if
Javascript is disabled because the end point is an rjs action or
something else not for human consumption.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.