Sha256: 1ab6e1d28a07bc72615e08c37ee7c19cfc76de3f4ec90eb280d849611d6ff1ae

Contents?: true

Size: 254 Bytes

Versions: 3

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])
    respond_with @comments
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
api_pagination_headers-2.0.1 spec/dummy/app/controllers/comments_controller.rb
api_pagination_headers-2.0.0 spec/dummy/app/controllers/comments_controller.rb
api_pagination_headers-1.1.2 spec/dummy/app/controllers/comments_controller.rb