diff app/controllers/tweets_controller.rb @ 164:59a4645fd24c

Correct way to check all numbers?
author nanaya <me@nanaya.pro>
date Fri, 03 Aug 2018 02:12:54 +0900
parents 3ff631612493
children 5af9b537db86
line wrap: on
line diff
--- a/app/controllers/tweets_controller.rb	Fri Aug 03 02:12:41 2018 +0900
+++ b/app/controllers/tweets_controller.rb	Fri Aug 03 02:12:54 2018 +0900
@@ -19,7 +19,7 @@
 
   def validate_id
     id = params[:id].split("/")[0]
-    if id.to_i == id
+    if id[/\D/].nil?
       params[:id] = id
     else
       try_redirect