xml.instruct! xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do xml.title "Feed Name" xml.link "rel" => "self", "href" => url_for(:only_path => false, :controller => 'feeds', :action => 'atom') xml.link "rel" => "alternate", "href" => url_for(:only_path => false, :controller => 'posts') xml.id url_for(:only_path => false, :controller => 'posts') xml.updated @posts.first.updated_at.strftime "%Y-%m-%dT%H:%M:%SZ" if @posts.any? xml.author { xml.name "Author Name" } @posts.each do |post| xml.entry do xml.title post.title xml.link "rel" => "alternate", "href" => url_for(:only_path => false, :controller => 'posts', :action => 'show', :id => post.id) xml.id url_for(:only_path => false, :controller => 'posts', :action => 'show', :id => post.id) xml.updated post.updated_at.strftime "%Y-%m-%dT%H:%M:%SZ" xml.author { xml.name post.author.name } xml.summary "Post summary" xml.content "type" => "html" do xml.text! render(:partial => "posts/post", :post => post) end end end end
You need to create an account or log in to post comments to this site.