Create a devise user from Ruby console - Stack Overflow
I was using ruby on rails with Devise gem. I needed to create and save some user's from console to gain more access
Here is the link to the right answer and tricks for the devise console saving.
Create a devise user from Ruby console - Stack Overflow:
'via Blog this'
Here is the link to the right answer and tricks for the devise console saving.
newuser = User.new({
email: 'superadmin1@testing.com',
password: 'password',
password_confirmation: 'password'
})
newuser.skip_confirmation!
newuser.save
b. or use confirm! :
newuser = User.new({
email: 'superadmin2@testing.com',
password: 'password',
password_confirmation: 'password'
})
newuser.confim!
newuser.save
trick-2n addition, if you are using confirmable and want to skip the requirement for a confirmation email when creating new accounts you can do something like this:
newuser = User.new({ :email => 'admin@example.com',
:password => 'password',
:password_confirmation => 'password'})
newuser.skip_confirmation!
newuser.save
Create a devise user from Ruby console - Stack Overflow:
'via Blog this'