Over a million developers have joined DZone.

RSS Feed In .rxml Template

·
xml.rss('version' => '2.0') do
  xml.channel do 
    xml.title(page_title)
    xml.link(@request.protocol + @request.host_with_port + url_for(:rss => nil))
    xml.description(page_title)
    @posts.each { |p|
      xml.item do 
        xml.title(p.title)
        xml.link(@request.protocol + @request.host_with_port + url_for(:controller => "posts", :action => "show", :id => p.id))
        xml.description(niceify_html_for_rss(p.content))
        xml.pubDate(p.updated_at)
      end
    }
  end
end
Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}