Module: System::Admin::UsersHelper

Included in:
Instance::UsersHelper
Defined in:
app/helpers/system/admin/users_helper.rb

Instance Method Summary collapse

Instance Method Details

Wraps the user count in a link unless the the linked page is the current page, or the user count is nil or zero.


5
6
7
8
9
# File 'app/helpers/system/admin/users_helper.rb', line 5

def user_count_link(page_params, user_count, link_params)
  return 0 unless user_count
  link_active = page_params[:active] == link_params[:active] && page_params[:role] == link_params[:role]
  link_active ? user_count : link_to(user_count, link_params)
end