Properly redirect to /agents after creating a new agent

Akinori MUSHA 9 ans auparavant
Parent
Commettre
e3f090ade8
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      app/controllers/agents_controller.rb

+ 1 - 1
app/controllers/agents_controller.rb

@@ -160,7 +160,7 @@ class AgentsController < ApplicationController
160 160
 
161 161
     respond_to do |format|
162 162
       if @agent.save
163
-        format.html { redirect_back "'#{@agent.name}' was successfully created." }
163
+        format.html { redirect_back "'#{@agent.name}' was successfully created.", return: agents_path }
164 164
         format.json { render json: @agent, status: :ok, location: agent_path(@agent) }
165 165
       else
166 166
         initialize_presenter