summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-02-28 18:00:06 +0100
committerhukl <contact@smyck.org>2009-02-28 18:00:06 +0100
commit4db284dfa4e130c53d00ad7d36a4593e2e181edb (patch)
tree7ebfcbd66aebb4ee5781477d379a7bf25421cc0d /app/helpers
parentbd9067272e1bd5a8651c5b9fa66881782406c54c (diff)
added author_for_page to content_helper
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/content_helper.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/helpers/content_helper.rb b/app/helpers/content_helper.rb
index 7747609..9950bda 100644
--- a/app/helpers/content_helper.rb
+++ b/app/helpers/content_helper.rb
@@ -6,6 +6,10 @@ module ContentHelper
6 page.published_at.to_s(:db) rescue page.created_at.to_s(:db) 6 page.published_at.to_s(:db) rescue page.created_at.to_s(:db)
7 end 7 end
8 8
9 def author_for_page page
10 page.user ? page.user.login : "Unknown author"
11 end
12
9 # This method is an output filter for templates. It accepts any kind of text 13 # This method is an output filter for templates. It accepts any kind of text
10 # and checks for an <aggregate /> tag within it. If such a tag is found, its 14 # and checks for an <aggregate /> tag within it. If such a tag is found, its
11 # attributes are parsed and converted into parameters for the 15 # attributes are parsed and converted into parameters for the
@@ -34,7 +38,7 @@ module ContentHelper
34 end 38 end
35 39
36 options[:partial] = select_partial( options[:partial] ) 40 options[:partial] = select_partial( options[:partial] )
37 41
38 content.sub(tag, render_collection(options)) 42 content.sub(tag, render_collection(options))
39 else 43 else
40 content 44 content