Class: Bookkeeper::SearchController

Inherits:
ApplicationController show all
Defined in:
app/controllers/bookkeeper/search_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



5
6
7
8
9
# File 'app/controllers/bookkeeper/search_controller.rb', line 5

def create
  @q = params[:search][:q]
  query = "%#{@q}%"
  @results = Purchase.where("title LIKE ? OR description LIKE ?", query, query)
end