# HG changeset patch # User Chris Cannam # Date 1358265089 0 # Node ID 2f6e71e31b55f6e428d9f398df46528b4edf7d9d # Parent a34a06ba1e33136512b6aec2a8cd74bbb17be5e1 Minor adjustments diff -r a34a06ba1e33 -r 2f6e71e31b55 app/controllers/attachments_controller.rb --- a/app/controllers/attachments_controller.rb Tue Jan 15 15:48:21 2013 +0000 +++ b/app/controllers/attachments_controller.rb Tue Jan 15 15:51:29 2013 +0000 @@ -115,7 +115,9 @@ def toggle_active @attachment.active = !@attachment.active? @attachment.save! - render :layout => false + respond_to do |format| + format.js + end end private diff -r a34a06ba1e33 -r 2f6e71e31b55 app/views/attachments/toggle_active.js.erb --- a/app/views/attachments/toggle_active.js.erb Tue Jan 15 15:48:21 2013 +0000 +++ b/app/views/attachments/toggle_active.js.erb Tue Jan 15 15:51:29 2013 +0000 @@ -1,2 +1,2 @@ -$("#active-<$= @attachment.id $>").update("This is a test"); +$('#active-<$= @attachment.id $>').html("This is a test");