2016-10-10 88 views
0

我一直试图让设计重定向我的导轨应用程序profile_new_path位置注册后。在注册后设计不重定向到特定位置

到目前为止,我...

@应用程序/控制器/ registrations_controller.rb

def after_sign_up_path_for(resource) 
    "/profiles/new" 
    end 
  • 我使用new_profile_path尝试,改变参数 “资源” 到 “用户” 和 “个人资料”

  • 我已经尝试在application_controller.rb中添加相同的方法

看来,无论我做什么设计重定向我profiles_path我指定的application_controller.rb

sign_in后指向任何人都可以提供关于如何sign_up后重定向到一个特定的路径一些帮助的路径。我真的很感激它。

回答

0

嗨你在你的routes.rb添加此,

devise_for :users, controllers: { registrations: "registrations" } 
0

希望this可以帮助你。

我在类似的工作,我重定向到最初欢迎控制器,然后根据用户授权重定向到特定页面。

+0

非常感谢,我会试试看 – Andrew