Forum: Ruby on Rails Extending the onclick properties with link_to ?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Bd3a9ca8a116e0055e65dd2d6069c946?d=identicon&s=25 Todd S. (tdog)
on 2006-02-18 05:57
I'm currently using a link_to function to generate an Ajax call.  I'd
like to be able to introduce other operations that occur upon click but
I'm not aware of a way to add to link_to's funtionality.

I have a div which is hidden and would like to set it to be visible
before (or after) the Ajax call.
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 Kevin Olbrich (Guest)
on 2006-02-18 08:16
(Received via mailing list)
Use link_to_remote.. it has a :before, :complete, and :loading callback
hook that you can use to perform AJAX actions.

Bd3a9ca8a116e0055e65dd2d6069c946?d=identicon&s=25 Todd S. (tdog)
on 2006-02-19 17:06
my mistake, I was actually using link_to_remote but I had never used the
:complete option.  This does the trick.  thanks.
This topic is locked and can not be replied to.