6
사용자가 로그인하지 않은 경우 사용자를 등록 페이지로 리디렉션하는 옵션이 없습니다. lib/devise/failure_app에 있습니다. rb, 리다이렉트 URL이 하드 코드 된 것처럼 보입니다.사용자가 로그인하지 않은 경우 등록 페이지로 리디렉션
def redirect_url
opts = {}
route = :"new_#{scope}_session_path"
opts[:format] = request_format unless skip_format?
if respond_to?(route)
send(route, opts)
else
root_path(opts)
end
end
나는 이것이 일을 끝내는 데있어서 가장 좋은 방법이라고 묻고 싶다. 수동으로 user_return_to 세션 값을 설정 한 다음 등록 페이지로 전화를 걸려고합니다. 그게 좋은 습관인가요? 나는 경우 로그인 페이지를 보여주고 싶은, 내가 레일에 새로 온 사람 https://github.com/plataformatec/devise/wiki/How-To%3A-Redirect-to-a-specific-page-when-the-user-can-not-be-authenticated
난 당신이 조금을 설명 할 수있는 위키 페이지를 이해 해달라고 : – pahnin