Skip to content
Max Ivak edited this page Jul 2, 2015 · 2 revisions

How it works

Controller

define filter in controller:

search_filter :filtername, {options,:store_session=>true} do

	field :title, :string, {options,..}
	field :category_id, :string, {options,..}

end

it creates a new method in controller

filter:

class Filter

class Filter - object methods:

.get_where - makes where from filter values

your model:

def search

Form

When the form is submitted it uses param filter_cmd=apply

Clone this wiki locally