Class: TableCollectionRenderer

Inherits:
ResourceRenderer::CollectionRenderer::Base show all
Defined in:
app/collection_renderers/table_collection_renderer.rb

Direct Known Subclasses

BootstrapTableCollectionRenderer

Defined Under Namespace

Classes: Header

Instance Attribute Summary collapse

Attributes inherited from ResourceRenderer::CollectionRenderer::Base

#collection, #helper, #options, #resource_class

Instance Method Summary collapse

Methods inherited from ResourceRenderer::CollectionRenderer::Base

#association

Constructor Details

#initialize(*args) ⇒ TableCollectionRenderer

Returns a new instance of TableCollectionRenderer.



86
87
88
89
90
# File 'app/collection_renderers/table_collection_renderer.rb', line 86

def initialize(*args)
  super
  options.reverse_merge(table_html_options: {})
  self.table_html_options = options.delete(:table_html_options)
end

Instance Attribute Details

#table_html_optionsObject

Returns the value of attribute table_html_options.



84
85
86
# File 'app/collection_renderers/table_collection_renderer.rb', line 84

def table_html_options
  @table_html_options
end

Instance Method Details

#render(&block) ⇒ Object



92
93
94
95
96
97
98
99
# File 'app/collection_renderers/table_collection_renderer.rb', line 92

def render(&block)
  helper.capture do
    helper.(:table, table_html_options) do
      helper.concat render_header(&block)
      helper.concat render_collection(&block)
    end
  end
end