X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/8181cb4bf77548088f959562f24be17f8ec053a3..276f165f3faca4913b63126de271530d2992a0ba:/app/controllers/diary_entry_controller.rb diff --git a/app/controllers/diary_entry_controller.rb b/app/controllers/diary_entry_controller.rb index 28eb903a3..13d3121a5 100644 --- a/app/controllers/diary_entry_controller.rb +++ b/app/controllers/diary_entry_controller.rb @@ -30,10 +30,15 @@ class DiaryEntryController < ApplicationController if params[:display_name] @this_user = User.find_by_display_name(params[:display_name]) @title = @this_user.display_name + "'s diary" - @entries = DiaryEntry.find(:all, :conditions => ['user_id = ?', @this_user.id], :order => 'created_at DESC') + @entry_pages, @entries = paginate(:diary_entries, + :conditions => ['user_id = ?', @this_user.id], + :order => 'created_at DESC', + :per_page => 20) else @title = "Users' diaries" - @entries = DiaryEntry.find(:all, :order => 'created_at DESC', :limit => 20) + @entry_pages, @entries = paginate(:diary_entries, + :order => 'created_at DESC', + :per_page => 20) end end