Class: CafeCar::Table::BodyBuilder
- Inherits:
-
ObjectsBuilder
- Object
- Builder
- ObjectsBuilder
- CafeCar::Table::BodyBuilder
- Defined in:
- lib/cafe_car/table/body_builder.rb
Instance Attribute Summary
Attributes inherited from Builder
Instance Method Summary collapse
Methods inherited from ObjectsBuilder
Methods inherited from Builder
#cell, #has?, #html_safe?, #initialize, #logo, #model_name, #remaining, #remaining_attributes, #shown, #shown!, #timestamp_attribute, #timestamps, #title, #to_s, #~@
Methods included from OptionHelpers
#assign_option!, #assign_options!, #get_options
Methods included from ProcHelpers
Constructor Details
This class inherits a constructor from CafeCar::Table::Builder
Instance Method Details
#to_html ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/cafe_car/table/body_builder.rb', line 3 def to_html ui.Body id: @objects.model_name.plural do |body| body << @template.turbo_stream_from(model_name.plural) @objects.each do |object| body << RowBuilder.new(@template, object:, **@options, &@block) end end end |