gist: 16577 Download_button fork
public
Public Clone URL: git://gist.github.com/16577.git
Text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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

Owner

ajmorris

Revisions