Hello,
I have the following link_to_remote code that calls the going method.
It works right but I want that after the call the name “Not going!”
changes to “I am going!”. Whats the easiest way to do this? I have a
going.js.rjs file which is below.
js file
if @attendance.errors.empty?
page.visual_effect(:highlight, “going”, :duration => 1)
end
def going
@attendance = Attendance.find(:first, :conditions => [“event_id = ?
and user_id = ?”, params[:id], current_user.id])
if @attendance.toggle!(:rsvp)
respond_to { |format| format.js }
end
end