Sha256: 498ddd69aac872698686a00f08cee4287a1ec78101f61ccb9c2db9812163d736

Contents?: true

Size: 805 Bytes

Versions: 3

Compression:

Stored size: 805 Bytes

Contents

xml.instruct! :xml, :version => '1.0'
xml.rss :version => '2.0', :'xmlns:atom' => 'http://www.w3.org/2005/Atom' do
  xml.channel do
    xml.title @blog.title
    xml.description "Latest articles from #{@blog.title}"
    xml.atom :link, :href => "http://#{Rails.application.config.main_host}#{@blog.feed}", :rel => 'self', :type => 'application/rss+xml'
    xml.link "http://#{Rails.application.config.main_host}#{@blog.feed}"

    @posts.each do |article|
      xml.item do
        xml.title article.title
        xml.description article.content
        xml.pubDate article.publication_date.to_s(:rfc822)
        @url = "#{request.protocol}#{request.host}#{":#{request.port}" if request.port}"
        xml.link "#{@url}#{article.path}"
        xml.guid "#{@url}#{article.path}"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
blog_logic-1.4.15 app/views/blogs/feed.rss.builder
blog_logic-1.4.14 app/views/blogs/feed.rss.builder
blog_logic-1.4.13 app/views/blogs/feed.rss.builder