From 2509f755a36b2fc944689d5a1ea62729d4d6c3a5 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Mon, 18 Aug 2014 18:19:29 -0400 Subject: [PATCH] 3114: Follow return_to param, if given, when redirecting users#show to projects#show. Don't redirect non-html requests. --- apps/workbench/app/controllers/users_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb index 189f295f8f..27f13b7205 100644 --- a/apps/workbench/app/controllers/users_controller.rb +++ b/apps/workbench/app/controllers/users_controller.rb @@ -7,7 +7,11 @@ class UsersController < ApplicationController def show if params[:uuid] == current_user.uuid - redirect_to project_path(params[:uuid]) + respond_to do |f| + f.html do + redirect_to(params[:return_to] || project_path(params[:uuid])) + end + end else super end -- 2.30.2