Posted By

rduv on 10/10/06


Tagged

rss


Versions (?)

Who likes this?

6 people have marked this snippet as a favorite

Memphys
yuconner
christessmer
SamuelMiller
skammer
webstic


rss2 template


 / Published in: Ruby
 

  1. xml.instruct!
  2.  
  3. xml.rss "version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/" do
  4. xml.channel do
  5.  
  6. xml.title "Feed Name"
  7. xml.link url_for :only_path => false, :controller => 'posts'
  8. xml.pubDate CGI.rfc1123_date @posts.first.updated_at if @posts.any?
  9. xml.description "Feed Description"
  10.  
  11. @posts.each do |posts|
  12. xml.item do
  13. xml.title post.name
  14. xml.link url_for :only_path => false, :controller => 'posts', :action => 'show', :id => post.id
  15. xml.description post.body
  16. xml.pubDate CGI.rfc1123_date post.updated_at
  17. xml.guid url_for :only_path => false, :controller => 'posts', :action => 'show', :id => post.id
  18. xml.author "#{post.author.email} (#{post.author.name})"
  19. end
  20. end
  21.  
  22. end
  23. end

Report this snippet  

You need to login to post a comment.