Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Transaction < ActiveRecord::Base
- ...
- searchable do
- text :description
- integer :id
- float :amount
- end
- ...
- end
- def search
- @search = Transaction.search do
- any_of do
- with(:amount, params[:search])
- with(:id, params[:search])
- fulltext(params[:search])
- end
- end
- @transactions = @search.results
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement