diff app/helpers/application_helper.rb @ 204:70e90ea4b870

Fix uri for nil user
author nanaya <me@nanaya.pro>
date Mon, 19 Oct 2020 04:08:30 +0900
parents 52252ae4b580
children 12287b32fbda
line wrap: on
line diff
--- a/app/helpers/application_helper.rb	Mon Oct 19 03:42:22 2020 +0900
+++ b/app/helpers/application_helper.rb	Mon Oct 19 04:08:30 2020 +0900
@@ -20,4 +20,8 @@
       urls[url] || url
     end
   end
+
+  def status_url(tweet)
+    "https://twitter.com/#{tweet.user.screen_name.presence || '_'}/status/#{tweet.id}"
+  end
 end