Skip to content

Commit

Permalink
Overwrite Bootstrap Link Renderer for WillPaginate
Browse files Browse the repository at this point in the history
Without this fix, the new will_paginate version is not compatible with the old version of bootstrap-will_paginate. This issue is also tracked here: mislav/will_paginate#649

Fixes CODEOCEAN-QK
  • Loading branch information
MrSerth committed Jun 14, 2023
1 parent 677289e commit 61b3c2a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions config/initializers/monkey_patches.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,13 @@ def average
end
end
end

module WillPaginate
module ActionView
class Bootstrap4LinkRenderer
def previous_or_next_page(page, text, classname, aria_label = nil)
tag :li, link(text, page || '#', :class => 'page-link', :'aria-label' => aria_label), :class => [(classname[0..3] if @options[:page_links]), (classname if @options[:page_links]), ('disabled' unless page), 'page-item'].join(' ')
end
end
end
end

0 comments on commit 61b3c2a

Please sign in to comment.