This gem was built for the easy installation of Pageless jquery plugin in Rails projects. Finally, an image (load.gif) and a javascript file (jquery.pageless.js) was packaged into a gem.
Since version 0.0.3, turbolinks is supported.
Demo Application:
https://github.com/jney/jquery.pageless.demo
Documentation in Korean:
http://happyrails.rorlab.org/ko/posts/62
Add this line to your application's Gemfile:
gem 'pageless-rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install pageless-rails
in Gemfile,
gem 'will_paginate'
gem 'pageless-rails', github: 'rorlab/pageless-rails'
in app/helpers/application_helper.rb,
def pageless(total_pages, url=nil, container=nil)
opts = {
:totalPages => total_pages,
:url => url,
:loaderMsg => 'Loading more pages...',
:loaderImage => image_path('load.gif')
}
container && opts[:container] ||= container
javascript_tag("$('#{container}').pageless(#{opts.to_json});")
end
in a view template file,
<div id="results">
<%= render @posts %>
</div>
<%= will_paginate @posts %>
<%= pageless(@posts.total_pages, posts_path, '#results') %>
That't it.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request