summaryrefslogtreecommitdiff
path: root/helpers
diff options
context:
space:
mode:
authorLars Henrik Mai <lars.mai@kontinui.de>2014-04-09 18:22:31 +0200
committerLars Henrik Mai <lars.mai@kontinui.de>2014-04-09 18:22:31 +0200
commit71855cf5438e3a77f5ffb09eaabc788a4a220403 (patch)
treebfc3da7e325bd7592df2a6034e25c77c19706d7c /helpers
parenta3995bf898c38ed755a3e1bd60b3b4aaf27670ec (diff)
better blog article summaries
Diffstat (limited to 'helpers')
-rw-r--r--helpers/blog_helpers.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/helpers/blog_helpers.rb b/helpers/blog_helpers.rb
new file mode 100644
index 0000000..566d4f8
--- /dev/null
+++ b/helpers/blog_helpers.rb
@@ -0,0 +1,8 @@
+module BlogHelpers
+
+ def article_paragraphs(article)
+ html = Nokogiri::HTML(article.body)
+ html.xpath("//p").map(&:text)
+ end
+
+end