Class: Warped::Emails::Table
- Defined in:
- lib/warped/emails/components/table.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#content, #helpers, #render_in
Methods included from Styleable
#base_styles, #default_variants, included, #style, #variants
Methods included from Slottable
Instance Method Details
#template ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/warped/emails/components/table.rb', line 23 def template raise ArgumentError, "at least one row must be passed to the table" if rows.empty? content_tag(:table, style:) do concat content_tag(:thead, header, style: style(:header)) concat content_tag(:tbody) do rows.each do |row| concat content_tag(:tr, row, style: style(:row)) end end end end |