This is going to be a very straightforward article, no jokes included. When you want to populate you database during development, you need to use a file that already comes in Rails: the file. You can find it inside the folder, the same where you can find the migration and schema files. seeds.rb db Aside from that you'll need two gems: the , and the . The last one is not actually necessary, but makes your life a lot easier, and your dummy data much more realistic. Populator gem Faker gem The Populator gem will allow you to do something close to what does in test environment: you'll set the data that will be provided, and the gem will automatically create several instances of your model to populate. If you only use Populator, you'll have to hardcode the content provided - not cool. Factory_bot That's where Faker comes in. It has a huge array of fake content that is available to you. It can generate names, emails, credit card numbers, addresses, you name it. It randomly returns one every time it is called. So, to the steps. 1 - Set your gems. Go to your Gemfile, and make it like this: group , gem gem :development :test do 'faker' 'populator' end Run in your terminal: bundle install Go to your folder. You'll have to do some patching in Populator gem if you use Rails version after 5.1. Inside the folder, create a file called . Copy the following code and paste inside it: lib lib populator_fix.rb @records.map quoted_attributes = record.attribute_values.map { @model_class.connection.quote(v) } module Populator # Builds multiple Populator::Record instances and saves them to the database class Factory def rows_sql_arr do |record| |v| "( )" #{quoted_attributes.join( )} ', ' end end end end Save it. Go to your seeds.rb file, and require this patch. On the first line, add the following: require_relative '../lib/populator_fix.rb' That's it. Your gems are set, let's do some code! 2 - Write your populate commands The Populate gem works like this. In the file, after the require, you'll call the model and pass a method called . You say how many instances you'd like to create, and inside the block you pass the data for the variables of your instances. Too abstract? Let's see some examples: seeds.rb populate You have a User model with the columns 'name' and 'email'. You could populate your database like this, using : Rails console User.new( , ) irb(main):001:0> name: 'Abraham' email: 'lincoln@president.org' And then save it. Ok for one. But what about 10? What about 100? You probably tried creating several instances in you projects manually just to almost die of boredom. Let's solve that. Inside the file, write like this: seeds.rb User.populate u.name = Faker::Name.first_name u.email = Faker::Internet.emwail 10 do |u| end Let's explain this code. Write the name of the model you're calling, followed by the method . Tell how many times you want to spin this loop. For each loop you are creating a new user, represented by the 'u' letter (you can name it whatever you want). Inside the block, you call the new instance (u) and the variable you want to fill. You could do like u.name = 'Abraham', and u.email = 'lincoln@president.org', but that would only create 10 'Abraham's, all with the same email. If you want your database to be filled with several different and real looking instances, you'll have to use Faker. populate Faker is a bless. You want to create a model of Food and create a hundred several instances, each with a different type of food? You don't have to go search for a list of food names and manually assign them. Just provide it inside the populate command: Food.populate f.name = Faker::Food.dish 100 do |f| end Check the to see all the potential. It's amazing. Faker documentation After you wrote all the populate commands in your seed.rb file, let's make the magic happen. 3 - Seed! Go to your terminal and call the following command: rails seed db: Considering you have all your tables working properly and already migrated (remember to use "rails db:migrate" before you seed), you'll have your database populated in no time. 4 - Enjoy! If you are using Rails after 5.1 you'll likely have an error if you don't use the fix for the Populator gem: X.X.X {your version} Check again the part of the fix; maybe you forgot to require the file inside the . NoMethodError: undefined method `sanitize' with Rails . seeds.rb Happy coding!