Ruby on Rails: Seed Data
When working in ruby on rails development mode, you can quickly add seed data to test your application using the db/seeds.rb file.
Step One: Add Seed Data
- Go to db/seeds.rb file.
- Add [datatablenamegoeshere].create(name: "[datagoeshere]"
- Add [datatablenamegoeshere].create(name: "[datagoeshere]"
- Add [datatablenamegoeshere].create(name: "[datagoeshere]"
Step Two: Test Data
- rake db:seed
- rake db:test:prepare