A couple of options here: As mentioned above, simple_format will help. Format your yml file as follows:
p3_html: | Some text: - Point 1 - Point 2 - Point 3
And then use
=simple_format t(:p3_html)
This will give you something like
<p>Some text <br> - Point 1 <br> - Point 2 <br> - Point 3 </p>
Or if you want a new paragraph to appear on each line:
p3_html: | Some text: - Point 1 - Point 2 - Point 3
Which should give you the following:
<p>Some text</p> <p>- Point 1</p> <p>- Point 2</p> <p>- Point 3</p>
or something like this more flexible
<% t(:p3_html).each_line do |line| %> <li>= |line|</li> <% end %>
Allows you to enter various formatting:
<li>- Point 1</li> <li>- Point 2</li> <li>- Point 3</li>
The final option is to use an array in yaml:
p3_html: - Some text: - - Point 1 - - Point 2 - - Point 3 <% t(:p3_html).each do |line| %> <p>= |line|</p> <% end %>
Possibly cleaner, although I think it will play hell with hellish commas, and the advantage over this version is that you can switch between formats without having to change your yaml
source share