Created
October 13, 2008 19:00
-
-
Save ajmorris/16577 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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