1 2 3 4 5 6 7 8
module BlogHelpers def article_paragraphs(article) html = Nokogiri::HTML(article.body) html.xpath("//p").map(&:text) end end