Class: Snaptable::Constructor::BaseTable
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Snaptable::Constructor::BaseTable
show all
- Includes:
- Collection, Renderer, Sortable
- Defined in:
- lib/snaptable/constructor/base_table.rb
Instance Method Summary
collapse
Methods included from Renderer
#attributes, #column_names, #enums, #format, #present, #respond, #string_to_class, #values
Methods included from Collection
#collection, #filter, #records
Methods included from Sortable
#css_class, #direction, #page, #sort_column, #sort_direction, #sortable
Constructor Details
#initialize(parent, collection = nil, options = {}) ⇒ BaseTable
13
14
15
16
17
18
|
# File 'lib/snaptable/constructor/base_table.rb', line 13
def initialize(parent, collection = nil, options = {})
super(parent)
@options = options
@collection = collection || model
@token = stored_token if Snaptable.use_permission
end
|
Instance Method Details
#options ⇒ Object
20
21
22
|
# File 'lib/snaptable/constructor/base_table.rb', line 20
def options
@options
end
|
#paginate_key ⇒ Object
32
33
34
|
# File 'lib/snaptable/constructor/base_table.rb', line 32
def paginate_key
"#{table_name}_page"
end
|
#table_name ⇒ Object
28
29
30
|
# File 'lib/snaptable/constructor/base_table.rb', line 28
def table_name
self.class.name.underscore
end
|
#url ⇒ Object
24
25
26
|
# File 'lib/snaptable/constructor/base_table.rb', line 24
def url
:id
end
|