Tag: kaminari
gem 'kaminari'
bundle install --path vendor/bundle
def index # @softwares = Software.all @softwares = Software.page(params[:page]) end
<%= paginate @softwares %>
※Bootstrap2でもうまくいく感じ。
$ bundle exec rails g kaminari:views bootstrap downloading app/views/kaminari/_first_page.html.erb from kaminari_themes... create app/views/kaminari/_first_page.html.erb downloading app/views/kaminari/_gap.html.erb from kaminari_themes... create app/views/kaminari/_gap.html.erb downloading app/views/kaminari/_last_page.html.erb from kaminari_themes... create app/views/kaminari/_last_page.html.erb downloading app/views/kaminari/_next_page.html.erb from kaminari_themes... create app/views/kaminari/_next_page.html.erb downloading app/views/kaminari/_page.html.erb from kaminari_themes... create app/views/kaminari/_page.html.erb downloading app/views/kaminari/_paginator.html.erb from kaminari_themes... create app/views/kaminari/_paginator.html.erb downloading app/views/kaminari/_prev_page.htm
ja: views: pagination: first: "« 最初" last: "最後»" previous: "‹ 前" next: "次 ›" truncate: "..."
config.i18n.default_locale = :ja
@pagenate_items = Kaminari.paginate_array(items).page(params[:page]).per(10)