Module: TableSortable::Controller
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/table_sortable/controller.rb
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#column_offset ⇒ Object
readonly
Returns the value of attribute column_offset.
-
#column_order ⇒ Object
readonly
Returns the value of attribute column_order.
-
#translation_key ⇒ Object
readonly
Returns the value of attribute translation_key.
Instance Method Summary collapse
- #columns ⇒ Object
- #define_column(col_name, *options) ⇒ Object
- #define_column_offset(offset) ⇒ Object
- #define_column_order(*order) ⇒ Object
- #define_translation_key(key) ⇒ Object
Instance Attribute Details
#column_offset ⇒ Object (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_order ⇒ Object (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_key ⇒ Object (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
#columns ⇒ Object
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, *) = .merge(.) @columns.add(col_name, ) 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 |