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
|
||||
@aspect = :search
|
||||
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)
|
||||
#only do it if it is an email address
|
||||
if params[:q].try(:match, Devise.email_regexp)
|
||||
|
|
|
|||
|
|
@ -25,7 +25,9 @@ var Search = {
|
|||
},
|
||||
options : function(){return {
|
||||
minChars : 3,
|
||||
max : 4,
|
||||
max : 5,
|
||||
scroll : false,
|
||||
extraParams : {limit : 4},
|
||||
formatItem : Search.formatItem,
|
||||
formatResult : Search.formatResult,
|
||||
parse : Search.parse,
|
||||
|
|
|
|||
Loading…
Reference in a new issue