Resting Pug logo Resting Pug

Description

Returns a hash with minimum and maximum per_page param like { page: 1, per_page: 10 }

Tip

Override #per_page_default to set default per_page param

Used in

Example

class BooksController < ApplicationController
  include RestingPug::Base

  private
  # Override a per_page_range to set minimum possible value for per_page 10 and maximum 20
  def per_page_range
    { min: 10, max: 20 }
  end
end

Source code

# lib/resting_pug/params.rb

def per_page_range
  { min: 5, max: 100 }
end
Find me on GitHub