0

I have an admin account which logs into a separate account page. I want to have the ability to add a new account without logging them in I tried using this

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

to redirect to the pre-existing sign up view but I keep running into the following message in the application.

You are already signed in.

What am I missing here?

Sophonias
  • 874
  • 5
  • 16
  • 38

1 Answers1

0

You will need to use a different route to avoid the checking done by devise, such as adding "resources :users" to routes.rb and link_to( "Add a New Account", new_user_path ) in the views.

However, this will clash with the paths used by devise. Thus leading you to the the link @PrakashMurthy recommended his the comment.

Something like this should work: (of course, you'll need the users_controller code too.)

add this your routes.rb

resources :admin_users, controller: "users"

and change this in your views

<%= link_to "Add a New Account", new_admin_user_path %>
roob
  • 1,116
  • 7
  • 11