Commit a162ef00465022200b7195d65ef78adb003e6371

Authored by Chris Cooke
Committed by Nick Recobra
1 parent d5995c47
Exists in master and in 1 other branch production

Limit the deploys list to 10 and paginate

app/controllers/deploys_controller.rb
@@ -17,7 +17,7 @@ class DeploysController < ApplicationController @@ -17,7 +17,7 @@ class DeploysController < ApplicationController
17 def index 17 def index
18 app = current_user.apps.find(:conditions => {:name => params[:app_id]}).first 18 app = current_user.apps.find(:conditions => {:name => params[:app_id]}).first
19 19
20 - @deploys = app.deploys.order_by(:created_at.desc) 20 + @deploys = app.deploys.order_by(:created_at.desc).paginate(:page => params[:page], :per_page => 10)
21 end 21 end
22 22
23 end 23 end
app/views/deploys/index.html.haml
1 - content_for :title, 'Deploys' 1 - content_for :title, 'Deploys'
2 = render 'table', :deploys => @deploys 2 = render 'table', :deploys => @deploys
  3 += will_paginate @deploys, :previous_label => '« Previous', :next_label => 'Next »'