From 4db284dfa4e130c53d00ad7d36a4593e2e181edb Mon Sep 17 00:00:00 2001 From: hukl Date: Sat, 28 Feb 2009 18:00:06 +0100 Subject: added author_for_page to content_helper --- app/helpers/content_helper.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 page.published_at.to_s(:db) rescue page.created_at.to_s(:db) end + def author_for_page page + page.user ? page.user.login : "Unknown author" + end + # This method is an output filter for templates. It accepts any kind of text # and checks for an tag within it. If such a tag is found, its # attributes are parsed and converted into parameters for the @@ -34,7 +38,7 @@ module ContentHelper end options[:partial] = select_partial( options[:partial] ) - + content.sub(tag, render_collection(options)) else content -- cgit v1.3