Skip to content

Commit

Permalink
Board setting: pagination per_page
Browse files Browse the repository at this point in the history
  • Loading branch information
lulalala committed Aug 24, 2015
1 parent 4ff3d8c commit 6f6b0c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/topics_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ class TopicsController < ApplicationController

# GET /topics
def index
@topics = @board.topics.order(bumped_at: :desc).page(params[:page]).per(5)
@topics = @board.topics.order(bumped_at: :desc).
page(params[:page]).
per(@board.config.pagination.per_page)
end

# GET /topics/1
Expand Down
2 changes: 2 additions & 0 deletions config/app_config.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ board:
n_recent_only: 5
avoid_only_n_hidden: 2
time_format: '%d %b %H:%M'
pagination:
per_page: 5

0 comments on commit 6f6b0c8

Please sign in to comment.