Ruby on rails 管理员如何在ruby Desive中添加其他用户或管理员帐户而不登录?

Ruby on rails 管理员如何在ruby Desive中添加其他用户或管理员帐户而不登录?,ruby-on-rails,ruby,devise,Ruby On Rails,Ruby,Devise,我有一个管理员帐户,登录到一个单独的帐户页面。我想有能力添加一个新的帐户,而不登录他们在我尝试使用这个 <%= link_to "Add a New Account", new_user_registration_path %> 我在这里遗漏了什么?您需要使用不同的路由来避免Desive所做的检查,例如在routes.rb中添加“resources:users”,并在视图中链接到(“Add a New Account”,New_user_path) 但是,这将与Desive使用的路

我有一个管理员帐户,登录到一个单独的帐户页面。我想有能力添加一个新的帐户,而不登录他们在我尝试使用这个

<%= link_to "Add a New Account", new_user_registration_path %>

我在这里遗漏了什么?

您需要使用不同的路由来避免Desive所做的检查,例如在routes.rb中添加“resources:users”,并在视图中链接到(“Add a New Account”,New_user_path)

但是,这将与Desive使用的路径冲突。因此,请点击链接@PrakashMurthy推荐他的评论

类似的东西应该可以工作:(当然,您也需要用户\控制器代码。)

将此添加到your routes.rb

resources :admin_users, controller: "users"
在你的观点中改变这一点

<%= link_to "Add a New Account", new_admin_user_path %>

请参阅@PrakashMurthy谢谢,但与我的问题不同。
<%= link_to "Add a New Account", new_admin_user_path %>