Devise의 github에서 코드를 사용해 보았습니다. 내 서버를 검사 할 때업데이트 후 변경 리디렉션
after_filter :store_location
def store_location
# store last url - this is needed for post-login redirect to whatever the user last visited.
if (request.fullpath != "https://stackoverflow.com/users/sign_in" &&
request.fullpath != "https://stackoverflow.com/users/sign_up" &&
request.fullpath != "https://stackoverflow.com/users/password")
session[:previous_url] = request.fullpath
puts 'stores location'
end
end
def after_update_path_for(resource)
session[:previous_url] || dashboard_path
puts 'after update'
end
의 store_location 방법에서 풋 문이 나타나지만 after_update_path_for에서 풋 문은하지 않습니다 : 내 응용 프로그램 컨트롤러, 나는있다. after_update_redirect를 작동 시키려면 어떻게해야합니까?
여기 고안 할 말하는이지만, 그것은 작동하지 않습니다 :
누구에게 아이디어가 있습니까? 나는 그것을 알아낼 수 없습니다. – Philip7899