Class: Bookkeeper::SearchController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Bookkeeper::SearchController
- Defined in:
- app/controllers/bookkeeper/search_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
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 |