title: Will_paginate in Dynamic pages as "search"
body: <p>I'm having trouble with <code>will_paginate</code>. It works perfectly with static pages but not in dynamic pages. In my controller I have:</p>
  
  <pre><code>def search 
    @prods = Prods.find_all_by_producer(params[:producer])
    @items = @prods.paginate(:page =&gt; params[:page], :per_page =&gt; 10)
  end
  </code></pre>
  
  <p>In my view:</p>
  
  <pre><code>&lt;%= will_paginate @items %&gt;
  </code></pre>
  
  <p>The first 10 items (the first page) are well displayed but when I try to navigate to next pages, I have:</p>
  
  <pre><code>undefined method `paginate' for nil:NilClass
  Parameters : {"page"=&gt;"2","locale"=&gt;nil}
  </code></pre>
  
  <p>I understand the issue, there is no <code>params[:producer]</code> when it calls the second page so <code>@prods</code> returns <code>nil</code>. But how to do that, any ideas?</p>