Module: Shoehorn::Helpers::AlertHelpers
- Defined in:
- lib/shoehorn/helpers/alert_helpers.rb
Instance Method Summary collapse
-
#bootstrap_alert(message, options = {}) ⇒ Object
Renders alert message.
Instance Method Details
#bootstrap_alert(message, options = {}) ⇒ Object
Renders alert message
Examples
bootstrap_alert("Hello!")
# => '<div class="alert"><a class="close">×</a>Hello!</div>'
bootstrap_alert("Hello!", type: 'error', close: false)
# => '<div class="alert alert-error">Hello!</div>'
bootstrap_alert("Content of alert", heading: "WARNING!", type: 'info')
# => '<div class="alert alert-info"><a class="close">×</a>
<h4 class="alert-heading">WARNING!</h4>Content of alert</div>'
Returns HTML String for the alert
29 30 31 32 33 34 |
# File 'lib/shoehorn/helpers/alert_helpers.rb', line 29 def bootstrap_alert(, = {}) Shoehorn::Components::Alert.new( , ).to_s end |