diff options
Diffstat (limited to 'app/helpers')
| -rw-r--r-- | app/helpers/content_helper.rb | 6 |
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 |
