3
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Rails 5 kaminari エラー undefined method `total_pages' の解決方法

Posted at

#kaminariを使ったときの undefined method `total_pages' の解決方法
before

films_controller.rb
def search
  @searched_films = Film.search(params[:search])
end

after

films_controller.rb
def search
  @searched_films = Film.search(params[:search])
  @searched_films = @searched_films.page(params[:page])
end

#参考
https://teratail.com/questions/63813

3
7
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
3
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?