I've written the following helper:
def section_to_html (block) case block[0].downcase when "paragraph" block.shift block.each do |value| return content_tag(:p, value) end end end
It is currently parsed these arrays.
["paragraph", "This is the first paragraph."] ["paragraph", "This is the second.", "And here's an extra paragraph."]
And it returns:
<p>This is the first paragraph.</p> <p>This is the second.</p>
Is there a way to accumulate the content_tag? so it returns:
<p>This is the first paragraph.</p> <p>This is the second.</p> <p>And here's an extra paragraph.</p>
My only solution right now is to use a partial instead. But that's going to get very messy once I starting adding more to case condition.