From 4e42a335c3213f32b2aca7e961942abe884ba0fc Mon Sep 17 00:00:00 2001 From: kinoppyd Date: Thu, 25 Apr 2024 19:43:05 +0900 Subject: [PATCH] set full path if not login --- app/controllers/application_controller.rb | 2 +- app/controllers/profiles_controller.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index fdf593ed..55aac0ab 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -70,7 +70,7 @@ def set_locale end def set_last_path - session[:last_path] = request.path + session[:last_path] = request.fullpath end def with_time_zone(&) diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index e9c43a8b..0c680981 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class ProfilesController < ApplicationController + skip_before_action :set_last_path + def show flash.keep if turbo_frame_request? @@ -9,6 +11,8 @@ def show else @user&.profile end + + set_last_path if @profile end def update