Module: FluidTable::InstanceMethods
- Included in:
- FluidTable
- Defined in:
- lib/fluid_table/instance_methods.rb
Instance Method Summary collapse
- #customize_column(column) ⇒ Object
- #displayed_columns ⇒ Object
-
#find_records ⇒ Object
Stub methods.
- #hidden_columns ⇒ Object
- #if_array_empty? ⇒ Boolean
- #initialize(view, render_options = {}) ⇒ Object
-
#render(records = find_records) ⇒ Object
Overwrite this method in your implementation to add table headers, etc.
- #render_footer ⇒ Object
- #render_header ⇒ Object
Instance Method Details
#customize_column(column) ⇒ Object
28 |
# File 'lib/fluid_table/instance_methods.rb', line 28 def customize_column(column) ; column ; end |
#displayed_columns ⇒ Object
11 12 13 |
# File 'lib/fluid_table/instance_methods.rb', line 11 def displayed_columns cloned_columns.select(&:display?).sort end |
#find_records ⇒ Object
Stub methods
27 |
# File 'lib/fluid_table/instance_methods.rb', line 27 def find_records ; [] ; end |
#hidden_columns ⇒ Object
15 16 17 |
# File 'lib/fluid_table/instance_methods.rb', line 15 def hidden_columns cloned_columns - displayed_columns end |
#if_array_empty? ⇒ Boolean
31 32 33 |
# File 'lib/fluid_table/instance_methods.rb', line 31 def if_array_empty? content_tag :td, %|There's nothing here|, :colspan => displayed_columns.size end |
#initialize(view, render_options = {}) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/fluid_table/instance_methods.rb', line 4 def initialize(view,={}) self.view = view load_cloned_columns self. = load_customizations end |
#render(records = find_records) ⇒ Object
Overwrite this method in your implementation to add table headers, etc.
20 21 22 23 24 |
# File 'lib/fluid_table/instance_methods.rb', line 20 def render(records = find_records) self.records = records rendered_table = content_tag :table, content_tag(:tbody,render_table_body), || {} render_header + rendered_table + end |
#render_footer ⇒ Object
30 |
# File 'lib/fluid_table/instance_methods.rb', line 30 def ; ActiveSupport::SafeBuffer.new ; end |
#render_header ⇒ Object
29 |
# File 'lib/fluid_table/instance_methods.rb', line 29 def render_header ; ActiveSupport::SafeBuffer.new ; end |