18577: workbench1: remove references to `redirect_to :back`, this
[arvados.git] / apps / workbench / app / controllers / application_controller.rb
index 04055f84852ed4628aaf5a9d32ea79d72c59907f..5312e733f41eb992131752ccf782e112b8c5af2e 100644 (file)
@@ -417,7 +417,11 @@ class ApplicationController < ActionController::Base
       respond_to do |f|
         f.json { render json: @object }
         f.html {
-          redirect_to(params[:return_to] || :back)
+          if params[:return_to]
+            redirect_to(params[:return_to])
+          else
+            redirect_back(fallback_location: root_path)
+          end
         }
         f.js { render }
       end
@@ -519,7 +523,7 @@ class ApplicationController < ActionController::Base
       redirect_to arvados_api_client.arvados_login_url(return_to: strip_token_from_path(request.url))
     else
       flash[:error] = "Either you are not logged in, or your session has timed out. I can't automatically log you in and re-attempt this request."
-      redirect_to :back
+      redirect_back(fallback_location: root_path)
     end
     false  # For convenience to return from callbacks
   end