Module: BMC::PaginationHelper
- Included in:
- AllHelpers
- Defined in:
- app/helpers/bmc/pagination_helper.rb
Class Attribute Summary collapse
Instance Method Summary collapse
- #paginate(objects, options = {}) ⇒ Object
- #pagination_and_infos(collection) ⇒ Object
- #pagination_infos(collection) ⇒ Object
Class Attribute Details
.theme ⇒ Object
5 6 7 |
# File 'app/helpers/bmc/pagination_helper.rb', line 5 def theme @theme ||= "bootstrap4" end |
Instance Method Details
#paginate(objects, options = {}) ⇒ Object
10 11 12 13 |
# File 'app/helpers/bmc/pagination_helper.rb', line 10 def paginate(objects, = {}) = {theme: BMC::PaginationHelper.theme}.merge() super(objects, **).gsub(/>(\s+)</, "><").html_safe end |
#pagination_and_infos(collection) ⇒ Object
19 20 21 |
# File 'app/helpers/bmc/pagination_helper.rb', line 19 def pagination_and_infos(collection) paginate(collection) + pagination_infos(collection) end |
#pagination_infos(collection) ⇒ Object
15 16 17 |
# File 'app/helpers/bmc/pagination_helper.rb', line 15 def pagination_infos(collection) tag.p(class: "pagination-infos") { page_entries_info(collection) } end |