Answer the question
In order to leave comments, you need to log in
How to do a search in Ruby on Rails?
How to make a request with a mask?
Something like @product=Product.where(name: '*Name*')
that is, I set a word in the search and I get all the lines containing this word in the name.
Answer the question
In order to leave comments, you need to log in
@products = Product.where("name LIKE ?", "%#{value_for_search}%")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question