class NeatPages::Helpers::Status < NeatPages::Helpers::Builder def generate return '' if empty? or out_of_bound? from, to = get_from_to_data return build_status from, to end def build_status(from, to) reset_builder b '' b "#{from+1}" b " #{t('to')} " b "#{to}/" b "#{total_items}" b '' return b end def get_from_to_data from = offset to = from + per_page to = total_items if to > total_items return [from, to] end end