Skip to content
Snippets Groups Projects
Commit 64983956 authored by maxwell's avatar maxwell
Browse files

MS added pagination to the search page

parent 07a8fa8b
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,8 @@ class AlbumsController < ApplicationController
respond_to :json, :only => [:index, :show]
def index
@albums = current_user.albums_by_aspect(@aspect).paginate
@albums = current_user.albums_by_aspect(@aspect).paginate :page => params[:page], :per_page => 9, :order => 'created_at DESC'
@aspect = :all
respond_with @albums, :aspect => @aspect
end
......
......@@ -11,7 +11,9 @@ class PeopleController < ApplicationController
def index
@aspects_dropdown_array = current_user.aspects.collect{|x| [x.to_s, x.id]}
@people = Person.search params[:q]
@aspect = :all
@people = Person.search(params[:q]).paginate :page => params[:page], :per_page => 25, :order => 'created_at DESC'
respond_with @people
end
......
......@@ -48,3 +48,4 @@
= f.select(:aspect_id, @aspects_dropdown_array)
= f.hidden_field :destination_url, :value => person.diaspora_handle
= f.submit "add friend"
= will_paginate @people
......@@ -11,8 +11,11 @@
#flash_alert {
z-index: 100;
top: 32px;
position: absolute;
color: black;
width: 400px;
margin: 0 0 0 -200px;
left: 50%;
text-align: center;
font-size: 14px;
padding: 3px 0; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment