This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RealtyRequestController < ApplicationController | |
#... other actions ... | |
def search | |
@s = Search.new(RealtyRequest,params[:search]) do |s| | |
s.contract_id :eq # value to search defaults to params[:search][:contract_id] | |
s.price_max :lteq # same here | |
s.price_min :gteq | |
s.zone :matches, "%#{params[:search][:zone]}%" # here I look for '%param%' | |
s.province :matches, "%#{params[:search][:province]}%" | |
s.municipality :matches, "%#{params[:search][:municipality]}%" |
NewerOlder