Class: NfgUi::Bootstrap::Components::Alert
- Defined in:
- lib/nfg_ui/bootstrap/components/alert.rb
Overview
Bootstrap Alert Component
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
#body, #options, #view_context
Instance Method Summary collapse
Methods included from Utilities::Themeable
Methods included from Utilities::Headable
Methods included from Utilities::Dismissible
Methods inherited from Base
#component_family, #data, #href, #html_options, #id, #initialize, #style
Constructor Details
This class inherits a constructor from NfgUi::Bootstrap::Components::Base
Instance Method Details
#render ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/nfg_ui/bootstrap/components/alert.rb', line 12 def render content_tag(:div, ) do capture do if dismissible concat( NfgUi::Bootstrap::Components::Button.new({ as: :button, class: 'close', theme: nil, data: { dismiss: 'alert' }, aria: { label: 'Close' } }, view_context).render do content_tag(:span, "×".html_safe, aria: { hidden: 'true' } ) end ) end if heading concat(content_tag(:h4, heading, class: 'alert-heading')) end concat(block_given? ? yield : body) end end end |