You can seed the database with data. Using db / seeds.rb plus rake db: seed
According to official documentation
Rails has a 'seeds' feature that should be used for seeding a database with initial data. It a really simple feature: just fill up db/seeds.rb with some Ruby code, and run rake db:seed:
5.times do |i|
Product.create(name: "Product ##{i}", description: "A product.")
end
This is generally a much cleaner way to set up the database of a blank application.
http://edgeguides.rubyonrails.org/migrations.html#migrations-and-seed-data
, , , .
, seeds.rb . Ruby, . , XML-.