Commit 0261b0c64c9df0a1a6834fa4f31395989244c2a9
1 parent
16e67fd8
Exists in
master
and in
4 other branches
Project activity inifinite scroll paging
Showing
3 changed files
with
8 additions
and
1 deletions
Show diff stats
app/controllers/projects_controller.rb
... | ... | @@ -46,7 +46,7 @@ class ProjectsController < ApplicationController |
46 | 46 | |
47 | 47 | def show |
48 | 48 | limit = (params[:limit] || 20).to_i |
49 | - @events = @project.events.recent.limit(limit) | |
49 | + @events = @project.events.recent.limit(limit).offset(params[:offset] || 0) | |
50 | 50 | |
51 | 51 | respond_to do |format| |
52 | 52 | format.html do |
... | ... | @@ -57,6 +57,7 @@ class ProjectsController < ApplicationController |
57 | 57 | render "projects/empty" |
58 | 58 | end |
59 | 59 | end |
60 | + format.js | |
60 | 61 | end |
61 | 62 | end |
62 | 63 | ... | ... |
app/views/projects/show.html.haml