How can i add user after login with Devise

I am a beginner, I need a idea regarding “After login i need to create a new user which we already use for signup method in new registrations”. Please help to do it.

Thanks

In the default devise configuration, /users/signup isn’t password-protected. Thus, you should be able to access it without problems to create a new user.

Hi Sir, Even though i used signup method after login it shows “You’re already sign-in”

You need to be logged out in order to access the signup page.

Sir, I need to add the user after admin login

You create the admin user from the console, with:

User.create!({:email => "hasan.diwan@gmail.com", :roles => ["admin"], :password => "111111", :password_confirmation => "111111" })

then you can create a normal user after logging out.

1 Like

You should build an administrator interface for creating users. Sign up is for creating an account and probably signing in. You genrally, most of the time , don’t want users to be able to sign up while they are login because this would expose users creating new users and that’s a difficult topic. Believe me, we are handling this case for many account created by a single user and it is difficult. So naturally by default devise would not allow you to sign up while you are signed in

1 Like