Properly redirect to /agents after creating a new agent

Akinori MUSHA 9 年之前
父節點
當前提交
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