1
嗨,我是新來的鐵軌,所以任何幫助將不勝感激。我已經成功安裝了寶石設計。我的模式中有兩張桌子;用戶(招聘人員)& Userj(求職者)。設計路由導軌4
問題:我想寫一個方法,說明如果註冊用戶是用戶(招聘人員)去recruiters_path否則如果用戶是Userj(求職者)去jobseekers_path。任何幫助或建議將不勝感激。
應用控制器
def after_sign_in_path_for(resource_or_scope)
if is_userr?(current_userr)
recruiters_path
else
jobseekers_path
end
end
任何幫助,將不勝感激。
感謝您@u天。因爲我使用的設計我沒有我的用戶(招聘人員和求職者)的控制器,但我使用您的格式在應用程序控制器中編寫了下面的代碼,它的工作原理非常好: *** def after_sign_in_path_for(resources) if userr_signed_in ? recruiters_path else jobseekers_path end end *** – ARTLoe 2015-04-02 10:27:01
welcome @ARTLoe – 2015-04-02 10:35:12