Skip to content

Commit

Permalink
Added date and ago to rss viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
cykod committed Sep 24, 2010
1 parent 4f0f827 commit 1a4e922
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions vendor/modules/feed/app/controllers/feed/rss_renderer.rb
Expand Up @@ -66,6 +66,9 @@ def feed
</cms:no_feed>
</div>
FEATURE


include ActionView::Helpers::DateHelper

def rss_feed_view_feature(data)
webiva_feature(:rss_feed_view,data) do |c|
Expand Down Expand Up @@ -109,6 +112,12 @@ def rss_feed_view_feature(data)
c.define_value_tag('feed:items:item:author') { |tag| tag.locals.item.author }
c.define_value_tag('feed:items:item:categories') { |tag| tag.locals.item.categories.map { |cat| cat.content }.join(", ") }
c.define_value_tag('feed:items:item:description') { |tag| tag.locals.item.description }
c.date_tag('feed:items:item:date') { |t| t.locals.item.date }



c.value_tag('feed:items:item:ago') { |t| distance_of_time_in_words_to_now(t.locals.item.date) if t.locals.item.date }



end
Expand Down

0 comments on commit 1a4e922

Please sign in to comment.