In my development and test environments, I want to seed the database with a bunch of users. I\'m using Ruby on Rails v3.2.8 and the latest Devise. So I added this line in
Just add :password attribute rest, devise will do password_encrypt for you
user = User.new({ email: 'test@example.com', password: 'EnterYourPassword'})
user.save!
flash[:notice] = 'User Created'
#or for extra logic
#if user.save
#ExtraCredentialsOrLogic
#elsif user.errors.any?
#user.errors.full_messages.each do |msg|
#puts msg
#end
#else
#puts "****NOT VALID****"
#end
and now run 'rake db:seed'