tvongaza / active_scaffold_list_filters

Filters for the Rails Active Scaffold Plugin
32 stars 16 forks source link

h2. ActiveScaffoldListFilters

Copyright (c) 2008 Tys von Gaza (tys@gotoybox.com)

MIT License use as you wish, see MIT-LICENSE file

Version 0.5

"Preview":http://farm4.static.flickr.com/3402/3257194048_1b75c0b966_o.png

Add a filter menu at the top of the ActiveScaffold List view. The filter can be whatever you dream up. Code inspiration: activescaffoldexport plugin.

h4. Todo/Know Bugs (Please Help!):

h4. Ideas for filters:

h3. Installing:

or an individual controller

active_scaffold "Model" do |config| config.actions.add :list_filter end

Add an Association (checkboxes) filter, named city, with the label Cities, but using the association named town:

active_scaffold "Model" do |config| config.list_filter.add(:association, :city, {:label => "Cities", :association => :town) end


h3. Creating your own filters:

It is simple to create your own filter.

You must then define the method find_options(params) to return a list of filter finder options. These will be used to filter your table's data. You have access to your the ListFilter that you're extending again with the same properties as above. You also have a list of parameters from your view. ** This file can also contain custom methods used in your view or conditions, sky is the limit!