Skip to content

Commit

Permalink
add pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
rmi22186 committed Sep 17, 2013
1 parent cf2a64b commit a753f07
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ gem 'simple_form'
gem "paperclip", "~> 3.0"
gem 'aws-sdk'
gem 'faker'
gem 'will_paginate'
gem 'bootstrap-will_paginate'

group :production do
gem 'pg'
Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ GEM
bcrypt-ruby (3.1.2)
bootstrap-sass (2.2.2.0)
sass (~> 3.2)
bootstrap-will_paginate (0.0.10)
will_paginate
builder (3.0.4)
climate_control (0.0.3)
activesupport (>= 3.0)
Expand Down Expand Up @@ -134,13 +136,15 @@ GEM
uuidtools (2.1.4)
warden (1.2.3)
rack (>= 1.0)
will_paginate (3.0.4)

PLATFORMS
ruby

DEPENDENCIES
aws-sdk
bootstrap-sass (~> 2.2.2.0)
bootstrap-will_paginate
coffee-rails (~> 3.2.1)
devise
faker
Expand All @@ -152,3 +156,4 @@ DEPENDENCIES
simple_form
sqlite3
uglifier (>= 1.0.3)
will_paginate
2 changes: 1 addition & 1 deletion app/controllers/pins_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class PinsController < ApplicationController
# GET /pins
# GET /pins.json
def index
@pins = Pin.order("created_at desc")
@pins = Pin.order("created_at desc").page(params[:page]).per_page(20)

respond_to do |format|
format.html # index.html.erb
Expand Down
4 changes: 3 additions & 1 deletion app/views/pins/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

<div id="pins">
<%= render @pins %>
</div>
</div>

<%= will_paginate @pins %>

0 comments on commit a753f07

Please sign in to comment.