class UiBibz::Ui::Core::Boxes::CardGrid

Create a card grid

Attributes

Options

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

Signatures

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

UiBibz::Ui::Core::Boxes::CardGrid.new(options = nil, html_options = nil) do |cg|
  cg.card content, options, html_options, &block
end

Examples

UiBibz::Ui::Core::Boxes::CardGrid.new do |cg|
  cg.card 'Exemple 1'
  cg.card 'Exemple 2'
  cg.card 'Exemple 3'
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/card_grid.rb, line 37
def initialize(content = nil, options = nil, html_options = nil, &block)
  super
end

Public Instance Methods

card(content = nil, options = nil, html_options = nil, &block) click to toggle source
# File lib/ui_bibz/ui/core/boxes/card_grid.rb, line 46
def card(content = nil, options = nil, html_options = nil, &block)
  @items << content_tag(:div, if tapped?(block)
                                UiBibz::Ui::Core::Boxes::Card.new(content, options, html_options).tap(&block).render
                              else
                                UiBibz::Ui::Core::Boxes::Card.new(content, options, html_options, &block).render
                              end, class: 'col')
end
pre_render() click to toggle source

Render html tag

# File lib/ui_bibz/ui/core/boxes/card_grid.rb, line 42
def pre_render
  content_tag :div, @items.join.html_safe, html_options
end

Private Instance Methods

component_html_classes() click to toggle source
# File lib/ui_bibz/ui/core/boxes/card_grid.rb, line 56
def component_html_classes
  super << 'card-grid'
end