diff options
Diffstat (limited to 'app/helpers/members_helper.rb')
-rw-r--r-- | app/helpers/members_helper.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/helpers/members_helper.rb b/app/helpers/members_helper.rb index 5dc636ad996..d3db5d24207 100644 --- a/app/helpers/members_helper.rb +++ b/app/helpers/members_helper.rb @@ -65,4 +65,14 @@ module MembersHelper 'group and any subresources' end + + def members_pagination_data(members, pagination = {}) + { + current_page: members.respond_to?(:current_page) ? members.current_page : nil, + per_page: members.respond_to?(:limit_value) ? members.limit_value : nil, + total_items: members.respond_to?(:total_count) ? members.total_count : members.count, + param_name: pagination[:param_name] || nil, + params: pagination[:params] || {} + } + end end |