= WillFilter will_filter is a Rails engine plugin that extends the functionality of will_paginate by adding filters to your pages. == Preamble If you ever had to build an admin tool for your web site that displayed a list of objects that can be filtered using various criteria, this plugin will make your life easier. Adding a filtered page can now be a matter of adding two lines of code - one to your controller and one to your view. See examples below. For advanced samples of how to use the filters, please download and install the following project: http://github.com/berk/will_filter_examples == Installation Instructions Add the following gems to your Gemfile: gem "will_paginate", "~> 3.0.pre2" gem 'will_filter', "~> 3.0.0" And run: $ bundle install To configure and initialize will_filter engine, run the following commands: $ rails generate will_filter $ rake db:migrate == Examples To add a filtered result-set to your controller use the following method call: class OrderController < ApplicationController def index @orders = Order.filter(:params => params) end end Note: 'Order' is a Rails ActiveRecord model Now all you have to do is create a view for this action and add the following tag where you want the filter to be rendered: <%= will_filter(@orders) %> And optionally you can do (for results table): <%= will_filter_table_tag(@orders) %> That's it. This will render a filter box with various conditions, operators and values for the model object you selected. Below are a couple of screenshot of what the filter looks like when it is rendered on a page: http://wiki.tr8n.org/images/d/da/Will_filter_1.png http://wiki.tr8n.org/images/e/ec/Will_filter_2.png will_filter_examples project contains some samples that show you how to customize filters and much more git://github.com/berk/will_filter_examples.git Live will_filter_examples application is running here: http://wf.tr8n.org If you have any questions, comments or suggestions, email me at michael@geni.com == Authors and credits Authors:: Michael Berkovich