jeudi 1 octobre 2015

jquery pageless more content link

how to make pageless show more load content link?

Even added results ID on the view helper the pageless still not show a link to load more content. or i have to scroll down everytime? thank's

pageless helper

def pageless(total_pages, url=nil, container=nil)
  opts = {
    :totalPages => total_pages,
    :url        => url,
    :loaderImage => image_path("load.gif")
  }

  container && opts[:container] ||= container

  javascript_tag("$('#results').pageless(#{opts.to_json});")
end

Js

$(document).ready(function() {

$('.chatboxcontent').pageless({ totalPages: 3,
                        url: '/conversations/',
                        loaderMsg: 'Loading',
                        loaderHtml: '<div></div>'                       });

    });

View

<%= render partial: 'conversation', :collection => @conversations %> 

<%= will_paginate(@conversations) %>
<div id="#results">Mais Mensagens<%=pageless(@conversations.total_pages, conversations_path) %></div>

Aucun commentaire:

Enregistrer un commentaire