Topic: Double Click with rails


I don't know how to implement double click (like ondblclick on javascript) with Ruby on Rails.

I have this code:

<%= link_to_remote (image_tag("/images/close_folder_list2_h.png")),{:url => {:controller => "projects", :action => "expand_list",:id_list =>},:update => @update_List} %>

I only need it to work  when I click twice on the link

Does someone know how I can do this with Rails?


Last edited by urisv30 (2011-03-14 18:08:38)

Re: Double Click with rails

well that's rails 2 syntax, and you don't use ruby to detect double click, only javascript. With jQuery I'd do something like this:

[first give the image an HTML ID]

    url: "/projects/expand_list",
    success: function(){

... something like that

Now this assumes you're using jQuery, which means you have to configure your app to use jQuery.

Secondly, for the ajax syntax in jQuery see documentation

Last edited by RailsRhino (2011-03-14 18:15:30)

- Ben