I'm having trouble understanding advanced search with two string pls help
error coms like:
undefined method `where' for #
<ActiveRecord::QueryMethods::WhereChain:0x007f2dcc0da5b0>
in the search model
search.rb
def search_books
books = Book.all
books = books.where{["name LIKE ?","%#{keywords}%"]}if keywords.present?
books = books.where{["category LIKE ?","%#{keywords}%"]}if keywords.present?
return books
end