Skip to content

Commit

Permalink
implement the planets feed
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Schubert committed Dec 14, 2014
1 parent 7a1f4f4 commit a40df1a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/planet_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ def index
end

def feed
# TODO implement me
@entries = Planet::Models::Entry.order(:published_at => :desc).limit 25
end
end
16 changes: 16 additions & 0 deletions app/views/planet/feed.atom.builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
atom_feed do |feed|
feed.title(t 'pages.planet.headline')
feed.updated(@entries.first.updated_at)

for entry in @entries
feed.entry(entry, :url => entry.url) do |feeditem|
feeditem.title(entry.title)

feeditem.author do |author|
author.name entry.author
end

feeditem.content(entry.body, :type => 'html')
end
end
end

0 comments on commit a40df1a

Please sign in to comment.