Module: Bh::AlertHelper
- Includes:
- BaseHelper
- Defined in:
- lib/bh/helpers/alert_helper.rb
Instance Method Summary collapse
-
#alert_box(message_or_options_with_block = nil, options = nil, &block) ⇒ String
Returns an HTML block tag that follows the Bootstrap documentation on how to display alert boxes.
Instance Method Details
#alert_box(message_or_options_with_block = nil, options = nil, &block) ⇒ String
Returns an HTML block tag that follows the Bootstrap documentation on how to display alert boxes. Alert boxes provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages. The message to display in the alert can either be passed as the first parameter (in which case, the options are the second parameter), or as a block (in which case, the options are the first parameter).
34 35 36 37 38 39 40 |
# File 'lib/bh/helpers/alert_helper.rb', line 34 def alert_box( = nil, = nil, &block) if block_given? alert_string capture_alert(&block), || {} else alert_string , || {} end end |