Class: Effective::TableRows::HasManyCard

Inherits:
Effective::TableRow show all
Defined in:
app/models/effective/table_rows/has_many_card.rb

Instance Attribute Summary

Attributes inherited from Effective::TableRow

#builder, #name, #options, #template

Instance Method Summary collapse

Methods inherited from Effective::TableRow

#content, #controller_namespace, #hint, #initialize, #label, #label_content, #tr_class, #value

Constructor Details

This class inherits a constructor from Effective::TableRow

Instance Method Details

#indexObject



21
22
23
# File 'app/models/effective/table_rows/has_many_card.rb', line 21

def index
  options[:index] || 0
end

#to_html(&block) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/models/effective/table_rows/has_many_card.rb', line 7

def to_html(&block)
  table = builder.render(&block)

  (:tr, class: "#{tr_class}-#{index+1}") do
    (:td, colspan: 2) do
      (:div, class: 'card my-3') do
        (:div, table, class: 'card-body') do
          (:h5, template.et(object) + " ##{index+1}", class: 'card-title') + table
        end
      end
    end
  end
end