diff app/views/tweets/_tweet.html.erb @ 103:1251b3d6ec5d

Use included url data instead of expanding using embiggen
author nanaya <me@myconan.net>
date Mon, 26 Sep 2016 02:39:40 +0900
parents c1d5d8be92c6
children 61414d0a367b
line wrap: on
line diff
--- a/app/views/tweets/_tweet.html.erb	Fri Sep 23 23:10:54 2016 +0900
+++ b/app/views/tweets/_tweet.html.erb	Mon Sep 26 02:39:40 2016 +0900
@@ -7,7 +7,14 @@
 <% else%>
   <p>
     <%# FIXME: Twitter gem doesn't support extended mode when writing this %>
-    <%= auto_link(expand_url(tweet.to_hash[:full_text])).gsub("\n", "<br>").html_safe %>
+    <%= auto_link(expand_url(
+          tweet.attrs[:full_text],
+          tweet.attrs[:entities][:urls],
+          tweet.attrs[:entities][:media]
+        ))
+        .gsub("\n", "<br>")
+        .html_safe
+      %>
   </p>
 
   <p>