kaminari undefined method `total_pages'
<p>While using kaminari, I got an error.</p>

<p>Gemfile:</p>

<pre><code># gem 'will_paginate', '~&gt; 3.0.6'
# gem 'will_paginate-bootstrap'

gem 'kaminari'
</code></pre>

<p>lists_controller.rb</p>

<pre><code>  def index
    if params[:tag]
      @lists = List.tagged_with(params[:tag]).order(created_at: :desc).paginate(page:params[:page], per_page: 3 )
    else
      @lists = List.all.order(created_at: :desc)
    end
  end
</code></pre>

<p>I also user <code>.page params[:page].per(2)</code> follow <code>.order(created_at: :desc)</code>
but not work</p>

<p>views/lists/index.html.erb</p>

<pre><code>&lt;%= paginate @lists %&gt;
</code></pre>

<p>the error is here</p>

<pre><code>undefined method `total_pages' for #&lt;List::ActiveRecord_Relation:0x007fa2303e3fa8&gt;
Extracted source (around line #26):             
    &lt;/div&gt;
  &lt;/div&gt;
&lt;%= paginate @lists %&gt;
  &lt;div class="container"&gt; 
    &lt;div class="row"&gt;
      &lt;div class="col-md-8"&gt;
</code></pre>

<p>I was following a railscasts video about kaminari, but they did not have any error.</p>