Merge pull request #5 from joergreichert/newsfeed

Newsfeed
This commit is contained in:
Jörg Reichert 2016-03-02 22:51:11 +01:00
commit abd23fb84c
2 changed files with 19 additions and 0 deletions

View file

@ -5,6 +5,7 @@ html
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
= javascript_include_tag 'vendor/modernizr' = javascript_include_tag 'vendor/modernizr'
= csrf_meta_tags = csrf_meta_tags
= auto_discovery_link_tag(:rss, params.merge(format: :rss))
body body
.row .row

View file

@ -0,0 +1,18 @@
xml.instruct! :xml, :version => "1.0"
xml.rss :version => "2.0" do
xml.channel do
xml.title "Search results"
xml.description "Papers matching search criteria"
xml.link root_url
@papers.each do |doc|
xml.item do
xml.title doc.name
xml.description truncate(doc.content, length: 768)
xml.pubDate doc.published_at.to_date.to_s(:rfc822)
xml.link doc.url
xml.guid doc.url
end
end
end
end