How to Implement ajax pagination with will_paginate gem
Create a new helper (ex. app/helpers/will_paginate_helper.rb) with the following content: module WillPaginateHelper class WillPaginateJSLinkRenderer < WillPaginate::ActionView::LinkRenderer def prepare(collection, options, template) options[:params] ||= {} options[:params][‘_’] = nil super(collection, options, template) end protected def link(text, target, attributes = {}) if target.is_a? Fixnum attributes[:rel] = rel_value(target) target = url(target) end @template.link_to(target, attributes.merge(remote: true)) do text.to_s.html_safe end end end … Read more