Module: TableSortable::Controller

Extended by:
ActiveSupport::Concern
Defined in:
lib/table_sortable/controller.rb

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#column_offsetObject (readonly)

Returns the value of attribute column_offset.



111
112
113
# File 'lib/table_sortable/controller.rb', line 111

def column_offset
  @column_offset
end

#column_orderObject (readonly)

Returns the value of attribute column_order.



111
112
113
# File 'lib/table_sortable/controller.rb', line 111

def column_order
  @column_order
end

#translation_keyObject (readonly)

Returns the value of attribute translation_key.



111
112
113
# File 'lib/table_sortable/controller.rb', line 111

def translation_key
  @translation_key
end

Instance Method Details

#columnsObject



69
70
71
# File 'lib/table_sortable/controller.rb', line 69

def columns
  @columns.sort_by(column_order)
end

#define_column(col_name, *options) ⇒ Object



52
53
54
55
# File 'lib/table_sortable/controller.rb', line 52

def define_column(col_name, *options)
  options = default_column_options.merge(options.extract_options!)
  @columns.add(col_name, options)
end

#define_column_offset(offset) ⇒ Object



61
62
63
# File 'lib/table_sortable/controller.rb', line 61

def define_column_offset(offset)
  @column_offset = offset
end

#define_column_order(*order) ⇒ Object



57
58
59
# File 'lib/table_sortable/controller.rb', line 57

def define_column_order(*order)
  @column_order = order
end

#define_translation_key(key) ⇒ Object



65
66
67
# File 'lib/table_sortable/controller.rb', line 65

def define_translation_key(key)
  @translation_key = key
end