What defines the data that you want to put in the database in advance By defining the data in advance, you can easily put the data in the database with a command.
db/seeds.rb
Category.create(name:'mens')
Category.create(name:'Women')
Category.create(name:'Kids')
% rails db:seed
Success if the database contains data
Recommended Posts