I'm working on trying to get Devise working in my Rails app. I'm a new Rails user. What's the proper way to add a few default users?
The normal way to set up any default data in Rails is by adding the data in db/seeds.rb
:
user1 = User.create :name => "User1", :email => "[email protected]", :password => "user123"
Depending on your validations and devise features you might need to enter more fields. In order to use that data you just call rake db:seed
.
rake db:migrate
rake db:seed
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With