filter:invoiced_to_id,type::user# In a helper file define method
defquery_report_user_filter(name,user_id,options={})user=User.find(user_id)concathidden_field_tagname,user_id,optionstext_field_tag"#{name}",user.name,class:'user_search'#implement the filter, it can be autocomplete
end
Parameters:
column
—
the column on which the filter is done on, for manual filter the column name can be anything
options(Hash)(defaults to: {})
—
a customizable set of options
Options Hash (options):
:type(Symbol)
—
date | text | whatever
:comp(Array)
—
the comparators used for ransack search, [:gteq, :lteq]
:manual(Boolean)
—
if set to true then that filter will not be applied, only will appear and can be used for custom application
:default(Object)
—
support default filter value, can be one value or for range filter can be array
31
32
33
34
# File 'lib/query_report/filter.rb', line 31deffilter(column,options={},&block)@filters||=[]@filters<<Filter.new(@params,column,options,&block)end