Browse Source

Redirect back with a notice after event deletion

Previously you would be redirected to `/events`, so it was not very easy
to delete many events from a list page like `/events?page=2` or
`/agents/5/events`.
Akinori MUSHA 9 years ago
parent
commit
f0fd34eb00
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/controllers/events_controller.rb

+ 1 - 1
app/controllers/events_controller.rb

@@ -33,7 +33,7 @@ class EventsController < ApplicationController
     @event.destroy
 
     respond_to do |format|
-      format.html { redirect_to events_path }
+      format.html { redirect_back events_path, notice: 'Event deleted.' }
       format.json { head :no_content }
     end
   end