Class: RUI::Table::Row
- Includes:
- Phlex::Rails::Helpers::DOMID
- Defined in:
- lib/rui/table.rb
Instance Method Summary collapse
-
#initialize(row:, columns:) ⇒ Row
constructor
A new instance of Row.
- #view_template ⇒ Object
Constructor Details
#initialize(row:, columns:) ⇒ Row
Returns a new instance of Row.
37 38 39 40 |
# File 'lib/rui/table.rb', line 37 def initialize(row:, columns:) @row = row @columns = columns end |
Instance Method Details
#view_template ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'lib/rui/table.rb', line 42 def view_template tr(id: dom_id(@row), class: "odd:bg-white even:bg-zinc-100 hover:bg-zinc-200") do @columns.each do |column| td(class: classes(column[:attrs][:class])) do column[:content].call(@row) end end end end |