From f7cd8cbccf41f821832232d520b4067fa7a4e5aa Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Fri, 16 Jun 2017 00:55:50 -0400 Subject: [PATCH] Add destination param --- app/controllers/records_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/records_controller.rb b/app/controllers/records_controller.rb index 81fc9be..56accf8 100644 --- a/app/controllers/records_controller.rb +++ b/app/controllers/records_controller.rb @@ -37,7 +37,7 @@ def index :entries => @records } end - respond_with @data + respond_with @data, :location => params[:destination] end # GET /records/1 @@ -114,7 +114,7 @@ def destroy authorize! :manage_account, current_account @record = current_account.records.find(params[:id]) @record.destroy - respond_with @record, :location => records_url + respond_with @record, :location => (params[:destination] || records_path) end def clone