回答編集履歴

1

別パターンを追加

2022/06/23 15:13

投稿

kai
kai

スコア92

test CHANGED
@@ -1,2 +1,5 @@
1
1
  こんな感じで行けるんではないでしょうか?
2
+ `Learn.where("title LIKE ? OR description LIKE ? ", "%#{search}%", "%#{search}%")`
3
+ もしくわ
2
4
  `Learn.where('title LIKE ?', "%#{search}%").or(where('description LIKE ?', "%#{search}%"))`
5
+ 動作確認等していないので恐縮ですが