Searchlogic plugin

Plugin details

Searchlogic's inspiration comes right from ActiveRecord. ActiveRecord lets you create objects that represent a record in the database, so why can't you create objects that represent searching the database? Now you can! Searchlogic makes searching, ordering, and paginating data easy with ActiveRecord.
It comes with nifty helpers for rails, so that you can easily search, order, and paginate your data in your views.
It comes with nifty helpers for rails, so that you can easily search, order, and paginate your data in your views.

Websitehttp://github.com/binarylogic/searchlogic/ Repositorygit://github.com/binarylogic/searchlogic.git Author Ben Johnson Tags searchgasm, ActiveRecord, model, Search, searching, paginate, Pagination, order, ordering, find LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install git://github.com/binarylogic/searchlogic.git
User.all(
        :conditions => {
            :first_name_contains => "Ben",          # first_name like '%Ben%'
            :email_ends_with => "binarylogic.com"   # email like '%binarylogic.com'
        },
        :per_page => 20     # limit 20
        :page => 3          # offset 40, which starts us on page 3
    )



or as an object:

search = User.new_search
user.conditions.first_name_contains = "Ben"
user.email_ends_with = "binarylogic.com"
user.per_page = 20
user.page = 3
user.all

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | Back in time (2 older versions) | Last edited by: binarylogic, 15 days ago