From d84b0c58bdda93af3f6b44181b3f2fc6657e61d4 Mon Sep 17 00:00:00 2001 From: Steven Fuchs <stwf@yahoo.com> Date: Wed, 7 Mar 2012 00:23:28 -0500 Subject: [PATCH] simplify search results processing since only one person can be returned --- app/controllers/people_controller.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 4a0c511fc0..a83e341196 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -48,13 +48,10 @@ class PeopleController < ApplicationController @people = Person.where(:diaspora_handle => search_query.downcase) @answer_html = "" unless @people.empty? - @people = @people.paginate(:page => params[:page], :per_page => 15) @hashes = hashes_for_people(@people, @aspects) self.formats = self.formats + [:html] - @hashes.each do |hash| - @answer_html += render_to_string :partial => 'people/person', :locals => hash - end + @answer_html = render_to_string :partial => 'people/person', :locals => @hashes.first end render :json => { :search_count => @people.count, :search_html => @answer_html }.to_json end -- GitLab