From d7ec763c7ce069824aad24a6bd0d845ee74ed10d Mon Sep 17 00:00:00 2001 From: hukl Date: Thu, 10 Sep 2009 16:01:41 +0200 Subject: added public rss controller plus template to render the latest 20 updates into a neat little atom feed --- app/views/rss/updates.xml.builder | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app/views/rss/updates.xml.builder (limited to 'app/views') diff --git a/app/views/rss/updates.xml.builder b/app/views/rss/updates.xml.builder new file mode 100644 index 0000000..541ad4e --- /dev/null +++ b/app/views/rss/updates.xml.builder @@ -0,0 +1,23 @@ +xml.instruct! +xml.feed(:xmlns => "http://www.w3.org/2005/Atom") do + xml.title("Chaos Computer Club Updates") + xml.link(:href => "http://www.ccc.de/") + xml.updated(@items.first.published_at) + xml.author("Chaos Computer Club e.V.") + xml.id("http://www.ccc.de/") + + @items.each do |item| + xml.entry do + xml.title(item.title) + port = (request.port != 80) ? port = ":#{request.port}" : "" + xml.link(request.protocol + request.host + port + item.public_link) + xml.id(request.protocol + request.host + port + item.public_link) + xml.updated(item.updated_at) + xml.content(:type => "xhtml") do + xml.div(item.body, :xmlns => "http://www.w3.org/1999/xhtml") + end + end + + end + +end \ No newline at end of file -- cgit v1.3