Module: RailsStuff::Helpers::Bootstrap
- Included in:
- All
- Defined in:
- lib/rails_stuff/helpers/bootstrap.rb
Constant Summary collapse
- BOOTSTRAP_FLASH_TYPE =
{ success: 'alert-success', error: 'alert-danger', alert: 'alert-warning', notice: 'alert-info', }.stringify_keys.freeze
- CROSS =
rubocop:disable Rails/OutputSafety
'×'.html_safe.freeze
- ICONS =
{ destroy: %(<span class='glyphicon icon-destroy'></span>), edit: %(<span class='glyphicon icon-edit'></span>), new: %(<span class='glyphicon icon-add'></span>), }.tap { |x| x.transform_values!(&:html_safe) if ''.respond_to?(:html_safe) }
Instance Method Summary collapse
Instance Method Details
#basic_link_icons ⇒ Object
32 33 34 |
# File 'lib/rails_stuff/helpers/bootstrap.rb', line 32 def basic_link_icons ICONS end |
#flash_messages ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/rails_stuff/helpers/bootstrap.rb', line 16 def = flash.map do |type, | content_tag :div, class: [:alert, BOOTSTRAP_FLASH_TYPE[type] || type] do content_tag(:button, CROSS, class: :close, data: {dismiss: :alert}) + simple_format() end end safe_join() end |