From e2e2fbbdc6b26e00101f5d4d1b05c0d076c817c2 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sat, 26 Jan 2013 16:22:52 +0100 Subject: Add a bit of AJAX to remove the just deleted row in call_history#index --- app/controllers/call_histories_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/controllers/call_histories_controller.rb') diff --git a/app/controllers/call_histories_controller.rb b/app/controllers/call_histories_controller.rb index 5335ed3..2bfd4e3 100644 --- a/app/controllers/call_histories_controller.rb +++ b/app/controllers/call_histories_controller.rb @@ -44,7 +44,10 @@ class CallHistoriesController < ApplicationController if can?(:destroy, @call_history) @call_history.destroy m = method( :"#{@parent.class.name.underscore}_call_histories_url" ) - redirect_to m.(), :notice => t('call_histories.controller.successfuly_destroyed') + respond_to do |format| + format.html { redirect_to m.(), :notice => t('call_histories.controller.successfuly_destroyed')} + format.js + end end end -- cgit v1.2.3