Class: Bently::Kaminari

Inherits:
RailsRecipe show all
Defined in:
lib/bently/recipe/kaminari.rb

Constant Summary

Constants inherited from RubyRecipe

RubyRecipe::GEMFILE

Instance Method Summary collapse

Methods inherited from RailsRecipe

#generate, #migrate

Methods inherited from RubyRecipe

#bundle, #gem, #gem_group

Methods inherited from Recipe

#append, breakdown, category, #code, #create, description, homepage, #insert, #modify, #operate, #operations, #prepend, #remove, #requirement, #run, #say, title, #todo, #usage, version, #warn

Constructor Details

#initializeKaminari

Returns a new instance of Kaminari.



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/bently/recipe/kaminari.rb', line 7

def initialize
  gem 'kaminari'
  bundle
  generate 'active_admin:install'
  migrate
  usage 'The page scope. To fetch the 7th page of users (default per_page is 25):'
  say '  User.page(7)', '1', :magenta
  usage 'To show a lot more users per each page (change the per_page value)'
  say '  User.page(7).per(50)', '1', :magenta
  usage 'Occasionally you need to pad a number of records that is not a multiple of the page size.'
  say '  User.page(7).per(50).padding(3)', '1', :magenta
end