class UiBibz::Ui::Core::Boxes::Components::CardRow

Create a card row

Attributes

Options

You can add HTML attributes using the html_options. You can pass arguments in options attribute:

Signatures

UiBibz::Ui::Core::Boxes::CardRow.new(content, options = nil, html_options = nil)

UiBibz::Ui::Core::Boxes::CardRow.new(options = nil, html_options = nil) do
  content
end

UiBibz::Ui::Core::Boxes::CardRow.new(options = nil, html_options = nil) do |row|
  row.col do
    content
  end
end

Examples

UiBibz::Ui::Core::Boxes::CardRow.new.render

UiBibz::Ui::Core::Boxes::CardRow.new do
  'Exemple'
end.render

UiBibz::Ui::Core::Boxes::CardRow.new do |row|
  row.col do
   'Exemple'
  end
end.render

Public Class Methods

new(content = nil, options = nil, html_options = nil, &block) click to toggle source

See UiBibz::Ui::Core::Component.initialize

Calls superclass method UiBibz::Ui::Core::Layouts::Row::new
# File lib/ui_bibz/ui/core/boxes/components/card_row.rb, line 48
def initialize(content = nil, options = nil, html_options = nil, &block)
  super
  @items = [@content]
end

Public Instance Methods

col(content = nil, options = nil, html_options = nil, &block) click to toggle source
# File lib/ui_bibz/ui/core/boxes/components/card_row.rb, line 57
def col(content = nil, options = nil, html_options = nil, &block)
  @items << if tapped?(block)
              UiBibz::Ui::Core::Boxes::Components::CardCol.new(content, options, html_options).tap(&block).render
            else
              UiBibz::Ui::Core::Layouts::Col.new(content, options, html_options, &block).render
            end
end
pre_render() click to toggle source
# File lib/ui_bibz/ui/core/boxes/components/card_row.rb, line 53
def pre_render
  content_tag :div, @items.join.html_safe, html_options
end