LoginSignup
0
0

More than 1 year has passed since last update.

備忘録 正規表現

Posted at
コントローラー使い方
モデル名.where("カラム名 LIKE?", "検索したい文字列")
# 例 nameカラムに「あ」という文字が入っているレコードを全て取得
User.where("name LIKE?", "%あ%")

ワイルドカード文字

% 0文字以上の任意の文字列
_ 任意の1文字
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0