Introduce per_page parameter for custom page size

This commit is contained in:
Sebastian Serth
2022-01-12 20:38:34 +01:00
parent 9d53ff20b5
commit 0a6ae91db8
17 changed files with 28 additions and 20 deletions

View File

@ -34,6 +34,14 @@ module ApplicationHelper
tag.i(nil, class: 'fa fa-times')
end
def per_page_param
if params[:per_page]
[params[:per_page].to_i, 100].min
else
WillPaginate.per_page
end
end
def progress_bar(value)
tag.div(class: value ? 'progress' : 'disabled progress') do
tag.div(value ? "#{value}%" : '', 'aria-valuemax': 100, 'aria-valuemin': 0,