Add ransacker info to README [skip ci]

This commit is contained in:
Jon Atack 2014-05-08 00:03:04 +02:00
parent 4ae224d2ce
commit d04bae7d80
1 changed files with 8 additions and 1 deletions

View File

@ -12,7 +12,7 @@ and maintained by [Ryan Bigg](http://twitter.com/ryanbigg),
[Jon Atack](http://twitter.com/jonatack) and a great group of [contributors](https://github.com/activerecord-hackery/ransack/graphs/contributors).
While it supports many of the same features as MetaSearch, its underlying
implementation differs greatly from MetaSearch,
and _backwards compatibility is not a design goal._
and **_backwards compatibility is not a design goal._**
Ransack enables the creation of both simple and
[advanced](http://ransack-demo.herokuapp.com/users/advanced_search)
@ -218,6 +218,13 @@ end
<% end %>
```
## Using Ransackers to add custom search functions with Arel
The main premise behind Ransack is to provide access to
**Arel predicate methods**. Ransack provides special methods, called _ransackers_, for creating additional search functions via Arel. More information about `ransacker` methods can be found [here in the wiki]
(https://github.com/activerecord-hackery/ransack/wiki/Using-Ransackers).
Feel free to contribute working `ransacker` code examples to the wiki!
## Using SimpleForm
If you want to combine form builders of ransack and SimpleForm, just set the RANSACK_FORM_BUILDER environment variable before Rails started, e.g. in ``config/application.rb`` before ``require 'rails/all'`` and of course use ``gem 'simple_form'`` in your ``Gemfile``: