2010-11-25 5 views

답변

0
+1

그래서 내가 세션을 사용할 수 있습니다

session[:any_key] = any value (though it should be small, think database id, instead of entire model) 

대부분의 사람들은 세션 사용 , 그리고 나서 sessi를 기반으로 on 값이 내 기본 경로를 정의합니까? – monvural

+0

경로는 응용 프로그램에서 가능한 모든 장소로 정의됩니다. 브라우저 세션 값에 따라 갈 장소를 파악할 수 있습니다. 따라서 간단히 redirect_to를 설정할 수 있습니다 (예 : 세션 [: old_user]가 redirect_to dashboard_path이면 redirect_to other_path end). – maletor

+0

보기에서만이 작업을 처리 할 수도 있습니다. 따라서 대시 보드의보기에 모든 것을 넣은 다음 사용자가 반환 할 내용을 표시 할 조건을 설정하십시오. http://api.rubyonrails.org/classes/ActionController/Redirecting.html#method-i-redirect_to – maletor

관련 문제