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?

Nick
  • 3,496
  • 7
  • 42
  • 96

1 Answers1

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
Babar Al-Amin
  • 3,939
  • 1
  • 16
  • 20