bhakku
bhakku

Reputation: 195

How to generate fake book names?

I am building a library management app in rails3.2. I am trying to generate book names for testing purposes. Is it possible to generate such book names using faker gem?

Upvotes: 3

Views: 3838

Answers (2)

saadlulu
saadlulu

Reputation: 1395

you can generate a book title using:

Faker::Book.title

you can also generate genre, publisher and author in the same way.

check Faker::book class here

Upvotes: 0

apneadiving
apneadiving

Reputation: 115531

Let's post it as an answer:

Faker::Lorem.words(number_of_words)

adjust number_of_words to what you desire.

Upvotes: 4

Related Questions