title: undefined method `will_paginate', Rails 3.1 / DataMapper
body: <p>Newly installed will_paginate 3.0.0</p>
  
  <pre><code>gem 'will_paginate', '~&gt; 3.0.0', :require=&gt;'will_paginate/data_mapper'
  </code></pre>
  
  <p>Running a controller query: </p>
  
  <pre><code>@tickets = Ticket.paginate(:page =&gt; params[:page], :per_page =&gt; 5,:username =&gt; @ticket.username)
  </code></pre>
  
  <p>Which works, pulls up all the tickets for a user and paginates in 5's if I put ?page=X where x is a page number in the url.</p>
  
  <pre><code>=will_paginate(@tickets) 
  </code></pre>
  
  <p>in the view does not work, this results in </p>
  
  <pre><code>undefined method `will_paginate' for #&lt;#&lt;Class:0x000000053674c8&gt;:0x0000000535cd48&gt;
  </code></pre>
  
  <p>So will_paginate works, but not the view helper. Am I missing something? I'm using slim templating if that makes any difference. Is there some syntax change I'm missing? The documentation is simple but unhelpful beyond this point. I looked into the source, and there does not seem to be any changes, but I cannot figure why it is inaccessible</p>
  
  <p>And then on tangent, this messes with an association.</p>
  
  <p>=> @instance.model_belonging_to_instance.create(:text=>'test')</p>
  
  <pre><code>TypeError: can't convert nil into Integer
      from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/will_paginate-3.0.0/lib/will_paginate/page_number.rb:16:in `Integer'
      etc etc et al
  </code></pre>
  
  <p>SOLUTION: </p>
  
  <p>gemfile:</p>
  
  <pre><code>gem 'will_paginate', '~&gt; 3.0.0'       # removed this, :require=&gt;'will_paginate/data_mapper'
  </code></pre>
  
  <p>intializer:</p>
  
  <pre><code>require 'will_paginate'
  require 'will_paginate/data_mapper'
  </code></pre>
  
  <p>It shows up, but if not at the top of the template, I get a </p>
  
  <p>stack level too deep</p>
  
  <p>error I am unable to interpret</p>