Skip to content

Instantly share code, notes, and snippets.

@barriault
Last active October 20, 2021 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barriault/c6daf62e1050ed48bd0787d98cbf8606 to your computer and use it in GitHub Desktop.
Save barriault/c6daf62e1050ed48bd0787d98cbf8606 to your computer and use it in GitHub Desktop.
I couldn't get the kaminari-cells gem to work with Rails 6, so I copied these two files from the gem into my project and made some slight changes.
# app/models/concerns/kaminary/cells.rb
module Kaminari
module Cells
extend ActiveSupport::Concern
included do
include Kaminari::Helpers::CellsHelper
end
end
end
# app/helpers/kaminary/helpers/cells_helper.rb
require 'kaminari/helpers/helper_methods'
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, paginator_class: Kaminari::Helpers::Paginator, template: nil, **options)
options = options.reverse_merge(:views_prefix => "../views/")
super
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment