X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/8181cb4bf77548088f959562f24be17f8ec053a3..ddd5b4cf19a92582fd114914be5bd5a04d3522a7:/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