Fix infinite scroll on search... some kind of weird thing with rails responding with json even when request.format is html, with a mime type of html
This commit is contained in:
parent
f60ce932b1
commit
3a18044821
1 changed files with 13 additions and 2 deletions
|
|
@ -30,7 +30,18 @@ class PeopleController < ApplicationController
|
|||
render :json => @people
|
||||
end
|
||||
|
||||
format.all do
|
||||
format.html do
|
||||
#only do it if it is an email address
|
||||
if params[:q].try(:match, Devise.email_regexp)
|
||||
people = Person.where(:diaspora_handle => params[:q])
|
||||
webfinger(params[:q]) if people.empty?
|
||||
else
|
||||
people = Person.search(params[:q], current_user)
|
||||
end
|
||||
@people = people.paginate( :page => params[:page], :per_page => 15)
|
||||
@hashes = hashes_for_people(@people, @aspects)
|
||||
end
|
||||
format.mobile do
|
||||
#only do it if it is an email address
|
||||
if params[:q].try(:match, Devise.email_regexp)
|
||||
people = Person.where(:diaspora_handle => params[:q])
|
||||
|
|
|
|||
Loading…
Reference in a new issue