How can I apply first example result to second example?
1) Case insensitive search result in Rails model
self.where("LOWER(shop_name) like ?", "%#{search.downcase}%")
2) advanced search
shops =Shop.where("shop_name LIKE '%#{keywords}%' AND shop_city LIKE '%#{keywords2}%' AND shop_country LIKE '%#{keywords3}%' AND market_type LIKE '%#{keywords4}%'") if keywords||keywords2||keywords3||keywords4.present?
Aucun commentaire:
Enregistrer un commentaire