Properly redirect to /agents after creating a new agent

Akinori MUSHA лет %!s(int64=9): %!d(string=назад)
Родитель
Сommit
e3f090ade8
1 измененных файлов с 1 добавлено и 1 удалено
  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