Displaying 1 result from an estimated 1 matches for "schoolprofile".
2007 Oct 03
3
Pagination problem with acts_as_ferret
...only 10 instead of 12
thats the right count.
Here''s my code:
Controller:
def search
@users = User.available_users
@user = User.find(session[:user_id])
@query = params[:query] || ''''
@total, @user_profiles = UserProfile.multi_search(@query, [ WorkProfile,
SchoolProfile ], :page => (params[:page]||1))
@pages = pages_for(@total)
unless @query.blank?
@results = UserProfile.find_by_contents @query
end
end
model:
def self.multi_search(q, additional_models = [], options = {})
return nil if q.nil? or q==""
default_options = {:limit => 1...