Tuesday, August 4, 2009

Using Searchlogic and Will Paginate

Here's the code to in controller to integrate the searching with binarylogic-searchlogic gem and pagination using mislav-will_paginate gem.

def index
@search = Enrollment.search(params[:search])
@enrollments, @enrollments_count = @search.paginate(:page => params[:page], :per_page => 20), @search.count
end

No comments:

Blog Archive