How to Use Faker in homemade Rails API

Elizabeth
Jan 16, 2021

The Faker Gem is so fun for seeding your database. Anyone can pull from this data generator by simply adding the following gem to your Gemfile and doing a bundle install.

Once your bundle install is complete you can reference anything from the faker database, and use this information to populate your API. For example see below, each new instance of message gets a different Hey Arnold quote.

Similarly, each reply gets a Hey Arnold quote.

This database is not just Hey Arnold quotes, below each instance of report has a Fresh Prince of Belair quote and a Fresh Prince of Belair character.

But theres more than just early 2000s TV show references, check it out yourself here!

--

--