Class: Ui::Component

Inherits:
Cell::ViewModel
  • Object
show all
Includes:
ActionView::Context, ActionView::Helpers::FormHelper, ActionView::Helpers::TagHelper, Layout::External
Defined in:
lib/ui/component.rb

Constant Summary collapse

VIEWPATH =
Pathname.new(__FILE__).join("../..")

Instance Method Summary collapse

Instance Method Details

#capture(*args) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/ui/component.rb', line 11

def capture(*args)
  content = yield(*args)
  if content.is_a?(String)
    content.html_safe
  else
    content
  end
end

#icon(style) ⇒ Object



24
25
26
# File 'lib/ui/component.rb', line 24

def icon(style)
  (:i, nil, class: style)
end

#render_group(items) ⇒ Object



20
21
22
# File 'lib/ui/component.rb', line 20

def render_group(items)
  items.compact.join(' ').html_safe
end