0

だから私の ArticlesController でこれを設定しました...

@most_recent_tweets = Twitter.home_timeline(count:1)

そして記事の index.html.erb ファイルで...

    <% @most_recent_tweets.each do |tweet| %>
        <%= tweet["attrs"] %>
    <% end %>

これは正常に動作します...次の出力が得られます...

{:created_at=>"Mon Nov 26 04:45:31 +0000 2012", :id=>272924019395813376, :id_str=>"272924019395813376", :text=>"Episode 394: STI and Polymorphic Associations (pro) http://t.co/UrLLdY1n", :source=>".....etc}

だからここに私の質問があります..どうすれば:textの値だけを表示できますか?

私は自分の出力が....

Episode 394: STI and Polymorphic Associations (pro) http://t.co/UrLLdY1n

どうすればいいですか?(お時間をいただきありがとうございます)

4

1 に答える 1

0

わかった...つぶやく[「テキスト」]

それで....

<% @most_recent_tweets.each do |tweet| %>
    <%= tweet["attrs"] %>
<% end %>

なる...

<% @most_recent_tweets.each do |tweet| %>
    <%= tweet["text"] %>
<% end %>
于 2012-11-27T17:58:54.157 に答える