あ、初投稿です。
textで検索できる機能はつけれたのですが、
textとtitle両方で検索できる機能は
どうやって書けますか?
ちなみに、railsとsequel proを使用してます!
ファイルは"product_controller.rb"です。
def search
@products = Product.where('text LIKE(?)', "%#{params[:keyword]}%").limit(20)
end
よろしくお願いします。
More than 5 years have passed since last update.
あ、初投稿です。
textで検索できる機能はつけれたのですが、
textとtitle両方で検索できる機能は
どうやって書けますか?
ちなみに、railsとsequel proを使用してます!
ファイルは"product_controller.rb"です。
def search
@products = Product.where('text LIKE(?)', "%#{params[:keyword]}%").limit(20)
end
よろしくお願いします。
Register as a new user and use Qiita more conveniently