Class: Bootstrap::ViewHelpers::Components::Alert
- Inherits:
-
Bootstrap::ViewHelpers::Component
- Object
- Bootstrap::ViewHelpers::Component
- Bootstrap::ViewHelpers::Components::Alert
- Defined in:
- lib/bootstrap/view_helpers/components/alert.rb
Instance Attribute Summary
Attributes inherited from Bootstrap::ViewHelpers::Component
#block, #options, #style, #view
Instance Method Summary collapse
- #alert_link_to(name = nil, opts = nil, html_options = nil, &block) ⇒ Object
-
#dismissible? ⇒ Boolean
Defaults to false.
-
#fade? ⇒ Boolean
Defaults to true.
- #to_html ⇒ Object
Methods inherited from Bootstrap::ViewHelpers::Component
Constructor Details
This class inherits a constructor from Bootstrap::ViewHelpers::Component
Instance Method Details
#alert_link_to(name = nil, opts = nil, html_options = nil, &block) ⇒ Object
13 14 15 16 |
# File 'lib/bootstrap/view_helpers/components/alert.rb', line 13 def alert_link_to(name = nil, opts = nil, = nil, &block) link_to(name, opts, .merge({ class: 'alert-link' }), &block) end |
#dismissible? ⇒ Boolean
Defaults to false
19 20 21 |
# File 'lib/bootstrap/view_helpers/components/alert.rb', line 19 def dismissible? [:dismissible] end |
#fade? ⇒ Boolean
Defaults to true
24 25 26 27 |
# File 'lib/bootstrap/view_helpers/components/alert.rb', line 24 def fade? return true if [:fade].nil? [:fade] end |
#to_html ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/bootstrap/view_helpers/components/alert.rb', line 5 def to_html content_tag(:div, ) do concat([:content]) if [:content] concat block.call(self) if block.present? end end |