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