18577: workbench1: remove references to `redirect_to :back`, this
[arvados.git] / apps / workbench / app / controllers / user_agreements_controller.rb
index bdfaa240335922e3b616bf4c10d791f34ded70ac..5e530a657e6e9474c661a0479cd60a245dd2b1d2 100644 (file)
@@ -9,7 +9,11 @@ class UserAgreementsController < ApplicationController
 
   def index
     if unsigned_user_agreements.empty?
-      redirect_to(params[:return_to] || :back)
+      if params[:return_to]
+        redirect_to(params[:return_to])
+      else
+        redirect_back(fallback_location: root_path)
+      end
     end
   end
 
@@ -24,6 +28,10 @@ class UserAgreementsController < ApplicationController
       end
     end
     current_user.activate
-    redirect_to(params[:return_to] || :back)
+    if params[:return_to]
+      redirect_to(params[:return_to])
+    else
+      redirect_back(fallback_location: root_path)
+    end
   end
 end