Sha256: b25fe387444ab62fa460fa4a827b08981b7b5966057e6c0762f34371e33d2a40
Contents?: true
Size: 348 Bytes
Versions: 2
Compression:
Stored size: 348 Bytes
Contents
module FlashHelper DEFAULT_MAPPING = { :notice => :info, :alert => :danger, :error => :danger, } def flash_messages messages = flash.map do |type, message| content_tag(:div, message, class: "alert alert-#{DEFAULT_MAPPING[type.to_sym] || type}", role: "alert") end safe_join(messages, "\n") end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ucb_rails_cli-1.3.0 | lib/ucb_rails_cli/templates/helpers/flash_helper.rb |
ucb_rails_cli-1.2.0 | lib/ucb_rails_cli/templates/helpers/flash_helper.rb |