在rails中想要使用like來搜尋的話,寫法如下
Post.where("content like ?", "%#{params[:search]}%")
model和要搜尋的東西請自行更改,搜尋關鍵字前後一定要加%,不然還是只會搜尋完全符合的項目