lib/sdr/pagination.rb
# Default to 30 items per page
# Permit up to 200 items per page, if more than 200 are requested, return 200
Default to 30 items per page
Permit up to 200 items per page, if more than 200 are requested, return 200
Default to 30 items per page Permit up to 200 items per page if more than 200 are requested return 200
def per_page
        max = 200
        if per = params[:per_page].to_i
          if per.between?(1, max)
            per
          elsif per > max
            max
          elsif per < 1
            30
          end
        else
          30
        end
      end
def per_page max = 200 if per = params [ :per_page ] . to_i if per . between? ( 1 , max ) per elsif per > max max elsif per < 1 30 end else 30 end end
Default to 30 items per page
Permit up to 200 items per page, if more than 200 are requested, return 200
Default to 30 items per page Permit up to 200 items per page if more than 200 are requested return 200