Sha256: bf9fa2aa7f550ba493bdcb0a726c9fd6545aed6d4e34711bec5283bf67516ab8

Contents?: true

Size: 239 Bytes

Versions: 6

Compression:

Stored size: 239 Bytes

Contents

class PostsController < ApplicationController
  after_action only: [:index] { set_pagination_headers(:posts) }

  def index
    @posts = Post.all.paginate(per_page: params[:per_page], page: params[:page])
    respond_with @posts
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
api_pagination_headers-2.0.1 spec/dummy/app/controllers/posts_controller.rb
api_pagination_headers-2.0.0 spec/dummy/app/controllers/posts_controller.rb
api_pagination_headers-1.1.2 spec/dummy/app/controllers/posts_controller.rb
api_pagination_headers-1.1.1 spec/dummy/app/controllers/posts_controller.rb
api_pagination_headers-1.1.0 spec/dummy/app/controllers/posts_controller.rb
api_pagination_headers-1.0.1 spec/dummy/app/controllers/posts_controller.rb