comparison app/controllers/tweets_controller.rb @ 233:0f0cc55ff11b

Character class, not literal D
author nanaya <me@nanaya.net>
date Fri, 14 Jul 2023 01:45:40 +0900
parents f9fd9d9cab97
children 7a773720d81f
comparison
equal deleted inserted replaced
232:4caedeaeea69 233:0f0cc55ff11b
2 def index 2 def index
3 return redirect if params[:id].present? || params[:name].present? 3 return redirect if params[:id].present? || params[:name].present?
4 end 4 end
5 5
6 def show 6 def show
7 return redirect if params[:id][/D/].present? 7 return redirect if params[:id][/\D/].present?
8 8
9 client = Tweet.new(params[:id].to_i) 9 client = Tweet.new(params[:id].to_i)
10 @user = client.user 10 @user = client.user
11 11
12 return redirect if normalized_screen_name != params[:name] 12 return redirect if normalized_screen_name != params[:name]