view app/views/tweets/_tweet.html.erb @ 62:9ab79a764434

Sweet tweet media viewer (image only for now)
author nanaya <me@myconan.net>
date Tue, 01 Dec 2015 01:08:37 +0900
parents
children a20bbd1e2dc1
line wrap: on
line source

<%= auto_link(tweet.text).html_safe %>

<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 %>