Sha256: b04b837f80739707c1e0d803ee2ea035279c325119858d312fb83c4be0ee523c
Contents?: true
Size: 989 Bytes
Versions: 1
Compression:
Stored size: 989 Bytes
Contents
module BootstrapHelpers module FlashMessageProccessor private def equal_bootstrap_class(flash_type) case flash_type.to_s.downcase when 'alert' 'error' when 'notice' 'success' when 'info' 'info' else 'warning' end end def flash_message_template(message,type) content_tag :div, :class=>"alert-message #{equal_bootstrap_class(type)} fade in", 'data-alert'=>'alert' do content_tag(:a, '×', :href=>'#', :class=>'close') + content_tag(:p) {message.to_s.html_safe} end end def flash_block_template(collection, type) content_tag :div, :class=>"alert-message #{equal_bootstrap_class(type)} block-message fade in", 'data-alert'=>'alert' do concat content_tag(:a, '×', :href=>'#', :class=>'close') collection.each {|message| concat content_tag(:p, message.to_s.html_safe)} end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
bootstrap_helpers-0.0.9 | lib/bootstrap_helpers/flash_message_proccessor.rb |