Skip to content

Instantly share code, notes, and snippets.

@ajmorris
Created October 13, 2008 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajmorris/16577 to your computer and use it in GitHub Desktop.
Save ajmorris/16577 to your computer and use it in GitHub Desktop.
xml.instruct! :xml, :version =>"1.0"
xml.feed(:xmlns => "http://www.w3.org/2005/Atom") do |feed|
feed.title('My Super Cool Feed!')
feed.link "rel" => "self", "href" => url_for(:only_path => false,
:controller => 'articles',
:action => 'atom')
feed.link "rel" => "alternate", "href" => url_for(:only_path => false,
:controller => 'articles')
feed.updated @articles.first.updated_at.strftime "%Y-%m-%dT%H:%M:%SZ" if @articles.any?
feed.author { feed.name "Academic Technologies" }
#feed.link('http://localhost:3500/')
@articles.each do |article|
xml.entry do
xml.title(article.title)
xml.link "rel" => "alternate", "href" => url_for(:only_path => false,
:controller => 'articles',
:action => 'show',
:id => article.id)
xml.id url_for(:only_path => false, :controller => 'articles',
:action => 'show', :id => article.id)
xml.updated article.updated_at.strftime "%Y-%m-%dT%H:%M:%SZ"
# xml.summary("article summary information could go here")
xml.content(article.content, :type => 'html')
# xml.content "type" => "html" do
# xml.text! render(:partial => "articles/index", :article => article)
# end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment