changeset 164:59a4645fd24c

Correct way to check all numbers?
author nanaya <me@nanaya.pro>
date Fri, 03 Aug 2018 02:12:54 +0900
parents ed73d92c7113
children 5af9b537db86
files app/controllers/tweets_controller.rb
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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