I am using Rails3 with jQuery and trying to make simple ajax calls. I have a link that displays the current status (online / offline) of the application. Clicking on it will update the status.
link_to app.status, { :controller => :apps, :action => :live_status, :id => app }, {:remote => true, :class => "#{app.status} status"}
live_status.js.erb:
$(this).fadeOut();
$(this).parent().html("<%= escape_javascript(status_link(@wowza_app)) %>");
$(this).fadeIn();
status_link will return updated link_to
However, $ (this) does not work as I imagine. How to update click status with new status?
source
share