diff options
author | Rémy Coutable <remy@rymai.me> | 2016-03-23 11:09:58 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-03-23 14:02:15 +0300 |
commit | e989d12b0768f0caa7ea1a429a2182e26bbf225a (patch) | |
tree | 5fb7e9787cd714cf711b603dc1b0ea389f6df8f8 /app/controllers/dashboard | |
parent | 7dc16346bba174d6075cf438adcd70a5596ba935 (diff) |
Use respond_to instead of a conditional to paginate milestones
Diffstat (limited to 'app/controllers/dashboard')
-rw-r--r-- | app/controllers/dashboard/milestones_controller.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/controllers/dashboard/milestones_controller.rb b/app/controllers/dashboard/milestones_controller.rb index 0a4a4088404..fa9c6c054f0 100644 --- a/app/controllers/dashboard/milestones_controller.rb +++ b/app/controllers/dashboard/milestones_controller.rb @@ -2,14 +2,15 @@ class Dashboard::MilestonesController < Dashboard::ApplicationController include GlobalMilestones before_action :projects - before_action :milestones, only: [:index] before_action :milestone, only: [:show] def index respond_to do |format| - format.html + format.html do + @milestones = Kaminari.paginate_array(milestones).page(params[:page]) + end format.json do - render json: @milestones + render json: milestones end end end |