How can I do an OnClick call using AJAX and Ruby on Rails? I have an application that allows you to ping an ip address by clicking on a link called 'ping'. When you click on it, the ping results get set inside a div tag. This works just as intended, however I would like the ping link to become unclickable and for the text to be changed to 'Pinging'. The problem is when I do the ajax call, the link gets updated at the same time as the div does. My intention is to prevent users from clicking on the link more then once, so by updating the link they can see that an operation is occuring in the background. In my mind I envision that the onclick would update the text of the link and commit the ajax call that would update the results div, does this sound right at all?
People succeed in answering Don Miguel de los Platanos's questions 42% of the time (8 successes in 19 attempts).