Pagination for the notifications
This commit is contained in:
parent
507a273716
commit
c7f3a9abfd
2 changed files with 6 additions and 2 deletions
|
|
@ -18,9 +18,12 @@ class NotificationsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@notifications = Notification.for(current_user).limit(25)
|
@notifications = Notification.for(current_user).paginate :page => params[:page], :per_page => 25
|
||||||
@group_days = @notifications.group_by{|note| note.created_at.strftime("%B %d") }
|
@group_days = @notifications.group_by{|note| note.created_at.strftime("%B %d") }
|
||||||
respond_with @notifications
|
respond_with @notifications
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def delete
|
||||||
|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -40,3 +40,4 @@
|
||||||
= object_link(note)
|
= object_link(note)
|
||||||
|
|
||||||
%span.time= "#{t('ago', :time => time_ago_in_words(note.created_at))}"
|
%span.time= "#{t('ago', :time => time_ago_in_words(note.created_at))}"
|
||||||
|
= will_paginate @people
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue