Module: SortNParams::SortHelpers

Defined in:
lib/sort_n_params/sort_helpers.rb

Instance Method Summary collapse

Instance Method Details

#sortable(column, title = nil) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/sort_n_params/sort_helpers.rb', line 5

def sortable(column, title = nil)
  data = Sortable.new(column, title, params).call
  capture do
    concat(
      link_to(data.title, data.sort_params, class: data.css)
    )

    concat_position(data) if data.position.present?

    concat_clear_params(data) if data.clear_params.present?
  end
end