Last active
October 20, 2021 23:33
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/models/concerns/kaminary/cells.rb | |
module Kaminari | |
module Cells | |
extend ActiveSupport::Concern | |
included do | |
include Kaminari::Helpers::CellsHelper | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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