view app/views/tweets/_tweet.html.erb @ 67:5dd24a65547b

Should be screen name (@-name), not just name.
author nanaya <me@myconan.net>
date Tue, 01 Dec 2015 01:36:45 +0900
parents eecb35eac2f3
children 585952f98978
line wrap: on
line source

<% if tweet.retweeted_status.present? %>
  <p>
    <em>Retweeted:</em>
  </p>

  <%= render "tweet", :tweet => tweet.retweeted_status %>
<% else%>
  <p>
    <%= link_to "https://twitter.com/#{tweet.user.screen_name}" do %>
      <%= image_tag tweet.user.profile_image_url_https %>
      <%= tweet.user.name -%>
    <% end %>

    /

    <%= auto_link(tweet.text).gsub("\n", "<br>").html_safe %>
  </p>

  <p>
    <% tweet.media.each do |media| %>
      <% if media.is_a? Twitter::Media::Photo %>
        <%= link_to "#{media.media_url_https}:orig" do %>
          <%= image_tag "#{media.media_url_https}:small" -%>
        <% end %>
      <% end %>
    <% end %>
  </p>

  <% if tweet.quoted_status.present? %>
    <blockquote>
      <%= render "tweet", :tweet => tweet.quoted_status %>
    </blockquote>
  <% end %>
<% end %>