· 1 min read

Screencast: Pagination mit Kaminari

Download:

Download(16 MB, 8:22) Alternativer Download für iPod & Apple TV(14.8 MB, 8:22)

Resourcen:

Quellcode:

[bash] bundle rails g kaminari:views default [/bash]

[ruby] # Gemfile gem ‘kaminari’

# products_controller.rb @products = Product.order(“name”).page(params[:page]).per(5) [/ruby]

[text] en: hello: “Hello world” views: pagination: previous: ”< Previous” next: “Next >” truncate: ”…” [/text]

[html] # products/index.html.erb <%= paginate @products %>

# app/views/kaminari/_prev_span.html.erb <%= raw(t ‘views.pagination.previous’) %> [/html]

Back to Blog