0

For a bit of quick-and-dirty hacking, I would like to get some text into a page. This doesn't seem to work...

home.html.erb

...
<h1>Heading</h1>
<div><% Faker::Lorem.paragraph(sentence_count = 3) %></div>
...

I have faker in my Gemfile.

This just produces an empty div. Is there a way of using Faker in this way or do I need to put it into a model?

TIA

Steve

2 Answers2

0

try this.

...
<h1>Heading</h1>
<div><%= Faker::Lorem.paragraph(sentence_count = 3) %></div>
...

note the equal sign. note the difference of ERB tags in general.

Community
  • 1
  • 1
glasz
  • 2,526
  • 25
  • 24
0

use <%= Faker::Lorem.paragraph(sentence_count = 3) %> with the "=" to print out the content

Vic
  • 1,512
  • 17
  • 25