From c7f3a9abfd579c2028b3c74bfb72f0fa52302542 Mon Sep 17 00:00:00 2001 From: Nick van der Burgt Date: Tue, 28 Dec 2010 21:53:31 +0100 Subject: [PATCH] Pagination for the notifications --- app/controllers/notifications_controller.rb | 7 +++++-- app/views/notifications/index.html.haml | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 3fc8f5a90..d7877f54e 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -18,9 +18,12 @@ class NotificationsController < ApplicationController end 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") } respond_with @notifications end - + + def delete + + end end diff --git a/app/views/notifications/index.html.haml b/app/views/notifications/index.html.haml index 45d504841..a2b8b6267 100644 --- a/app/views/notifications/index.html.haml +++ b/app/views/notifications/index.html.haml @@ -40,3 +40,4 @@ = object_link(note) %span.time= "#{t('ago', :time => time_ago_in_words(note.created_at))}" + = will_paginate @people