Sha256: 049b8eca041cba5773e66fa9ef4eef3e6198e2500d8a45a3426e494f5ad78005

Contents?: true

Size: 254 Bytes

Versions: 2

Compression:

Stored size: 254 Bytes

Contents

class CommentsController < ApplicationController
  after_action only: [:index] { set_pagination_headers(:comments) }

  def index
    @comments = Comment.all.paginate(per_page: params[:per_page], page: params[:page])
    render json: @comments
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
api_pagination_headers-2.1.1 spec/dummy/app/controllers/comments_controller.rb
api_pagination_headers-2.1.0 spec/dummy/app/controllers/comments_controller.rb