Class: ActionSet::Helpers::SortLinker

Inherits:
Object
  • Object
show all
Defined in:
lib/action_set/helpers/sort_linker.rb

Instance Method Summary collapse

Constructor Details

#initialize(template) ⇒ SortLinker

Returns a new instance of SortLinker.



6
7
8
# File 'lib/action_set/helpers/sort_linker.rb', line 6

def initialize(template)
  @template = template
end

Instance Method Details

#render(column, title = nil) ⇒ Object



10
11
12
13
14
15
# File 'lib/action_set/helpers/sort_linker.rb', line 10

def render(column, title = nil)
  column = column.to_s
  title ||= sort_link_title(column)

  @template.link_to title, sort_link_url(column)
end