class TableSortable::Columns
Public Class Methods
new()
click to toggle source
Calls superclass method
# File lib/table_sortable/columns.rb, line 4 def initialize super end
Public Instance Methods
add(col_name, *options)
click to toggle source
# File lib/table_sortable/columns.rb, line 8 def add(col_name, *options) options = options.extract_options! self << TableSortable::Column.new(col_name, options) end
sort_by(sort_key)
click to toggle source
# File lib/table_sortable/columns.rb, line 13 def sort_by(sort_key) if sort_key sort_key.map{|c| self.find{|col| (c.is_a?(String) ? (col.label == c) : col.name == c)}} else self end end