comparison 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
comparison
equal deleted inserted replaced
163:ed73d92c7113 164:59a4645fd24c
17 17
18 private 18 private
19 19
20 def validate_id 20 def validate_id
21 id = params[:id].split("/")[0] 21 id = params[:id].split("/")[0]
22 if id.to_i == id 22 if id[/\D/].nil?
23 params[:id] = id 23 params[:id] = id
24 else 24 else
25 try_redirect 25 try_redirect
26 end 26 end
27 end 27 end