integrate @knu's suggestions

This commit is contained in:
Andrew Cantino 2015-08-16 16:05:22 -07:00
parent ce84f159e0
commit 8713dce4d8

View file

@ -239,6 +239,8 @@ class AgentsController < ApplicationController
when "show"
if @agent && !@agent.destroyed?
path = agent_path(@agent)
else
path = agents_path
end
when /\A#{Regexp::escape scenarios_path}\/\d+\z/, agents_path
path = ret
@ -247,7 +249,7 @@ class AgentsController < ApplicationController
if path
redirect_to path, notice: message
else
redirect_to agents_path, notice: message
super agents_path, notice: message
end
end