apotonick / kaminari-cells

Kaminari pagination in Cells.
MIT License
23 stars 15 forks source link

Breaks with Kaminari 1.0.0 #6

Closed tjjjwxzq closed 7 years ago

tjjjwxzq commented 7 years ago

This is due to a change in organization of Kaminari's code. In particular we should be including Kaminari::Helpers::HelperMethods now instead of Kaminari::ActionViewExtension

# lib/kaminari-cells.rb

require "cells"
require "kaminari/helpers/helper_methods"
require "kaminari/cells/version"
require "cell/partial"

module Kaminari
  module Helpers
    module CellsHelper
      include Kaminari::Helpers::HelperMethods
      include ActionView::Helpers::OutputSafetyHelper
      include ActionView::Helpers::TranslationHelper
      include Cell::ViewModel::Partial

      def paginate(scope, options = {}, &block)
        options = options.reverse_merge(:views_prefix => "../views/")
        super
      end
    end
  end
end

require 'kaminari/cells'

Can there be separate branches for pre- and post-1.0.0 support?

apotonick commented 7 years ago

Oh no, are they still using Rails helpers instead of Cells for this? :cry:

Yeah, master should be 1.0, and then we have a 0.x branch?

tjjjwxzq commented 7 years ago

Yes please :smile:

apotonick commented 7 years ago

Just PR it to master!

george-carlin commented 7 years ago

Fixed by https://github.com/apotonick/kaminari-cells/pull/8

EDIT: oops, I mean it was fixed by #7 ;)