title: Rails jQuery pageless problem
body: <p>Here's the deal,</p>
  
  <p>I'm trying to solve why pageless (infinite scroll) isn't rendering.  Using <a href="https://github.com/jney/jquery.pageless" rel="nofollow">this jQuery Plugin</a></p>
  
  <p>I have my index page of products with pagination by will_paginate:</p>
  
  <pre><code>def index
    @products = Product.find(:all, :order =&gt; "position DESC").paginate(:per_page =&gt; 3, :page =&gt; params[:page])
  
    if request.xhr?
      render :partial =&gt; 'shared/products', :object =&gt; @products
    end
  end
  </code></pre>
  
  <p>My index page is calling the products partial</p>
  
  <pre><code>&lt;%= render "shared/products", :object =&gt; @products %&gt;
  </code></pre>
  
  <p>Which in turn is passing the collection onto a singular product partial</p>
  
  <pre><code>&lt;%= render 'shared/product', :collection =&gt; @products %&gt;
  </code></pre>
  
  <p>And calling pageless on it if javascript is enabled (otherwise will_paginate steps in.</p>
  
  <pre><code>&lt;%= pageless(@products.total_pages, products_path) %&gt;
  
  -----------
  
  def pageless(total_pages, url=nil, container=nil)
    opts = {
      :totalPages =&gt; total_pages,
      :url        =&gt; url,
      :loaderMsg  =&gt; 'Loading more results'
    }
    container &amp;&amp; opts[:container] ||= container
  
    javascript_tag("$('#results').pageless(#{opts.to_json});")
  end
  </code></pre>
  
  <p>And finally here is the code for the singular product partial</p>
  
  <pre><code>&lt;% @products.each do |product| %&gt;
    &lt;li id="product_&lt;%= product.id %&gt;"&gt;
      &lt;%= link_to product_image(product), product %&gt;
    &lt;/li&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Now when I load the page, there are no js errors, I can see the pages getting loaded in my server logs and yet nothing is rendering.  Everything seems to work perfectly and yet it doesn't render.  Any help would be appreciated.</p>
  
  <p>-Scott</p>