I am currently using link_to_remote
in my Ruby on Rails app to render remote content using Prototype. Unfortunately if you click the created link more than once, it re-renders the content.
What I would like to do is somehow disable the link after it is first clicked.
This is the code I am currently using,
<%= link_to_remote (
"#{user.name}",
:update => "#{user.id}_div",
:url => { :controller => "wishlist_items", :action => "load", :id => user.id },
:position => "after",
:html => {:class => "#{user.id}_href"} )
%>
I do know that you can use :success
and :complete
to call JavaScript, but I am just not sure how to do this.
Any help would be much appreciated. Thank you.