We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a80a88 commit 61718ddCopy full SHA for 61718dd
app/controllers/tweets_controller.rb
@@ -1,4 +1,7 @@
1
class TweetsController < ApplicationController
2
+ def index
3
+ @tweets = Tweet.first 20
4
+ end
5
6
def show
7
@tweet = Tweet.find(params[:id])
app/views/tweets/index.atom.builder
@@ -0,0 +1,17 @@
+atom_feed root_url: tweets_url do |feed|
+ feed.title "RubyFriends"
+ feed.updated @tweets.first.updated_at
+
+ @tweets.each do |tweet|
+ feed.entry tweet, url: tweet.media_display_url, id: tweet.tweet_id do |entry|
+ entry.url tweet.media_display_url
8
+ entry.title "@#{tweet.username}: #{tweet.tweet_text.truncate 50}"
9
+ entry.content tweet.tweet_text, type: :html
10
+ entry.updated tweet.updated_at.iso8601
11
12
+ entry.author do |author|
13
+ author.name "@#{tweet.username}"
14
15
16
17
+end
0 commit comments