Correct limit on search autocomplete
This commit is contained in:
parent
423cd7807b
commit
bbe47fbb55
2 changed files with 5 additions and 2 deletions
|
|
@ -11,8 +11,9 @@ class PeopleController < ApplicationController
|
||||||
def index
|
def index
|
||||||
@aspect = :search
|
@aspect = :search
|
||||||
params[:q] ||= params[:term]
|
params[:q] ||= params[:term]
|
||||||
|
limit = params[:limit] || 15
|
||||||
|
|
||||||
@people = Person.search(params[:q], current_user).paginate :page => params[:page], :per_page => 15
|
@people = Person.search(params[:q], current_user).paginate :page => params[:page], :per_page => limit
|
||||||
@hashes = hashes_for_people(@people, @aspects)
|
@hashes = hashes_for_people(@people, @aspects)
|
||||||
#only do it if it is an email address
|
#only do it if it is an email address
|
||||||
if params[:q].try(:match, Devise.email_regexp)
|
if params[:q].try(:match, Devise.email_regexp)
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,9 @@ var Search = {
|
||||||
},
|
},
|
||||||
options : function(){return {
|
options : function(){return {
|
||||||
minChars : 3,
|
minChars : 3,
|
||||||
max : 4,
|
max : 5,
|
||||||
|
scroll : false,
|
||||||
|
extraParams : {limit : 4},
|
||||||
formatItem : Search.formatItem,
|
formatItem : Search.formatItem,
|
||||||
formatResult : Search.formatResult,
|
formatResult : Search.formatResult,
|
||||||
parse : Search.parse,
|
parse : Search.parse,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue