Module: Sort::LinkForHelper

Includes:
DescriptionForHelper, PathForHelper
Included in:
ActionSet::Helpers::HelperMethods
Defined in:
lib/action_set/helpers/sort/link_for_helper.rb

Instance Method Summary collapse

Methods included from DescriptionForHelper

#sort_description_for

Methods included from NextDirectionForHelper

#next_sort_direction_for

Methods included from FormattingHelper

#ascending_str, #descending_str

Methods included from CurrentDirectionForHelper

#current_sort_direction_for

Methods included from Params::CurrentHelper

#current_params

Methods included from PathForHelper

#sort_path_for

Instance Method Details



11
12
13
14
15
16
17
# File 'lib/action_set/helpers/sort/link_for_helper.rb', line 11

def sort_link_for(attribute, name = nil, **attributes)
  link_to(name || attribute.to_s.titleize,
          sort_path_for(attribute),
          **attributes.merge(
            'aria-label': sort_description_for(attribute)
          ))
end