Here's the fix I used (Inspired by this blog post).
(in helpers/application_helper.rb)
def link_to_remote(name, options = {}, html_options = {})
unless html_options[:href]
html_options[:href] = url_for(options[:url])
end
link_to_function(name, remote_function(options),
html_options)
end
Just keep in mind that this uses a HTTP GET when javascript is disabled. A HTTP GET should not have side effects. I can't think of a good way to do a HTTP POST from a link (trigger a form-post) without using javascript.
2 comments:
mate this was brilliant exactly what i needed thanks heaps
Just wanted to add my thanks for your post.
Was just what I was looking for and am trying it as I type :-)
Post a Comment