summaryrefslogtreecommitdiff
path: root/app/helpers/blog_helper.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2012-08-24 21:12:36 -0700
committerelijah <elijah@riseup.net>2012-08-24 21:12:36 -0700
commit627f0488e5bd3c31359fc9e78acffbfea4a86a8b (patch)
treef7b14733e314cf82d5fa3e18cbe9d98c2ffe5c7c /app/helpers/blog_helper.rb
parentb774dea07f97b078fa17e5dcbf901d1c83fed0d6 (diff)
committed website v. 0.1.0
Diffstat (limited to 'app/helpers/blog_helper.rb')
-rw-r--r--app/helpers/blog_helper.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/helpers/blog_helper.rb b/app/helpers/blog_helper.rb
new file mode 100644
index 0000000..20e4113
--- /dev/null
+++ b/app/helpers/blog_helper.rb
@@ -0,0 +1,15 @@
+module BlogHelper
+
+ def recent_blog_summaries(path)
+ root = StaticPage.find(path)
+ if root
+ pages = root.all_children.order_by(:posted_at).limit(PAGINATION_SIZE)
+ haml do
+ pages.each do |page|
+ haml render(:partial => 'layouts/blog/summary', :locals => {:page => page})
+ end
+ end
+ end
+ end
+
+end