Module: Spotlight::BlacklightConfigurationsHelper

Defined in:
app/helpers/spotlight/blacklight_configurations_helper.rb

Instance Method Summary collapse

Instance Method Details

#translate_sort_fields(sort_config) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'app/helpers/spotlight/blacklight_configurations_helper.rb', line 3

def translate_sort_fields(sort_config)
  if sort_config[:sort]
    safe_join(sort_config[:sort].split(',').map do |sort|
      sort_field, sort_order = sort.split(' ')
      safe_join([
        t(:"spotlight.blacklight_configurations.edit_sort_fields.sort_keys.#{sort_field}"),
        t(:"spotlight.blacklight_configurations.edit_sort_fields.sort_keys.#{sort_order}")
      ], " ")
    end, ", ")
  end
end