Skip to content

Instantly share code, notes, and snippets.

@TheNicholasNick
Created April 9, 2009 18:20
Show Gist options
  • Save TheNicholasNick/92646 to your computer and use it in GitHub Desktop.
Save TheNicholasNick/92646 to your computer and use it in GitHub Desktop.
xml.instruct!
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
xml.title Blog.title
xml.id Blog.url_base
xml.updated @posts.first.created_at.iso8601 if @posts.any?
xml.author { xml.name Blog.author }
@posts.each do |post|
xml.entry do
xml.title post.title
xml.link "rel" => "alternate", "href" => post.full_url
xml.id post.full_url
xml.published post.created_at.iso8601
xml.updated post.created_at.iso8601
xml.author { xml.name Blog.author }
xml.summary post.summary_html, "type" => "html"
xml.content post.body_html, "type" => "html"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment