LoginSignup
4
3

More than 5 years have passed since last update.

kaminari と draperを共存させる方法

Posted at

起きた事象

  • paginationを gem kaminariで実装後、gem draperを導入。
undifinend methode error
 :offset_value, :total_count

が生じる。

対策

gem draperを見たら、書いてありました。

1.config/initializer/draper.rb を作成。

2. ファイルに下記コードを記述する。
 Draper::CollectionDecorator.delegate :current_page, :total_pages, 
 :limit_value, :total_count, :offset_value

参考

Draper と kaminari を一緒に使う
gem draper

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3