Module: Bh::ModalHelper
- Includes:
- BaseHelper
- Defined in:
- lib/bh/helpers/modal_helper.rb
Overview
Provides methods to include modals.
Instance Method Summary collapse
-
#modal(content_or_options_with_block = nil, options = nil, &block) ⇒ String
Returns an HTML block tag that follows the Bootstrap documentation on how to display modals.
Instance Method Details
#modal(content_or_options_with_block = nil, options = nil, &block) ⇒ String
Returns an HTML block tag that follows the Bootstrap documentation on how to display modals.
The content of the modal 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 paramter).
36 37 38 39 40 41 42 43 44 |
# File 'lib/bh/helpers/modal_helper.rb', line 36 def modal( = nil, = nil, &block) if block_given? modal_string , &block elsif .is_a?(Hash) && .nil? modal_string , &Proc.new { nil } else modal_string , &Proc.new { } end end |