4

I use the Faker gem to seed my db with fake data. For some variables I for example use Faker::Lorem.paragraph(4). But what I would really want is to seed with text that has styling in it. Such as <p></p><b> etc. Is this possible with the Faker gem?

1 Answer 1

7

You can use Faker::Lorem.paragraphs(4). It returns an array, which you can then modify as needed. Like:

Faker::Lorem.paragraphs(4).map{|pr| "<p>#{pr}</p>"}.join

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.