changeset 126:c9864cf35950

Now with explicit alt text
author nanaya <me@nanaya.pro>
date Wed, 30 Aug 2017 14:52:25 +0900
parents 61414d0a367b
children 05216b67d01d
files app/views/tweets/_tweet.html.erb
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/app/views/tweets/_tweet.html.erb	Wed Aug 23 16:35:58 2017 +0900
+++ b/app/views/tweets/_tweet.html.erb	Wed Aug 30 14:52:25 2017 +0900
@@ -19,16 +19,16 @@
 
   <p>
     <%= link_to "https://twitter.com/#{tweet.user.screen_name}" do %>
-      <%= image_tag tweet.user.profile_image_url_https %>
+      <%= image_tag tweet.user.profile_image_url_https, :alt => "profile image for #{tweet.user.name.printable}" %>
       <%= tweet.user.name.printable -%>
     <% end %>
   </p>
 
   <p>
-    <% tweet.media.each do |media| %>
+    <% tweet.media.each_with_index do |media, i| %>
       <% if media.is_a? Twitter::Media::Photo %>
         <%= link_to "#{media.media_url_https}:orig" do %>
-          <%= image_tag "#{media.media_url_https}:small" -%>
+          <%= image_tag "#{media.media_url_https}:small", :alt => "attachment #{i + 1}" -%>
         <% end %>
       <% end %>
     <% end %>