simplify search results processing since only one person can be returned
This commit is contained in:
parent
9de477cf5a
commit
d84b0c58bd
1 changed files with 1 additions and 4 deletions
|
|
@ -48,13 +48,10 @@ class PeopleController < ApplicationController
|
||||||
@people = Person.where(:diaspora_handle => search_query.downcase)
|
@people = Person.where(:diaspora_handle => search_query.downcase)
|
||||||
@answer_html = ""
|
@answer_html = ""
|
||||||
unless @people.empty?
|
unless @people.empty?
|
||||||
@people = @people.paginate(:page => params[:page], :per_page => 15)
|
|
||||||
@hashes = hashes_for_people(@people, @aspects)
|
@hashes = hashes_for_people(@people, @aspects)
|
||||||
|
|
||||||
self.formats = self.formats + [:html]
|
self.formats = self.formats + [:html]
|
||||||
@hashes.each do |hash|
|
@answer_html = render_to_string :partial => 'people/person', :locals => @hashes.first
|
||||||
@answer_html += render_to_string :partial => 'people/person', :locals => hash
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
render :json => { :search_count => @people.count, :search_html => @answer_html }.to_json
|
render :json => { :search_count => @people.count, :search_html => @answer_html }.to_json
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue