Sha256: dd360babb3ec54a7cb2cd95c5f28f3786ec1b7e66dcfa16c97664292fc20b6d6

Contents?: true

Size: 417 Bytes

Versions: 7

Compression:

Stored size: 417 Bytes

Contents

module ApplicationHelper
  def bootstrap_class_for(flash_type)
    { success: "alert-success", error: "alert-danger", alert: "alert-warning", notice: "alert-info" }.stringify_keys[flash_type.to_s] || flash_type.to_s
  end

  def flash_messages
    flash.each do |flash_type, message|
      concat(content_tag(:div, message, class: "alert #{bootstrap_class_for(flash_type)}", role: 'alert'))
    end
    nil
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mobile_workflow-0.10.2 lib/generators/mobile_workflow/install/templates/app/helpers/application_helper.rb
mobile_workflow-0.10.1 lib/generators/mobile_workflow/install/templates/app/helpers/application_helper.rb
mobile_workflow-0.10.0 lib/generators/mobile_workflow/install/templates/app/helpers/application_helper.rb
mobile_workflow-0.9.0 lib/generators/mobile_workflow/install/templates/app/helpers/application_helper.rb
mobile_workflow-0.8.9 lib/generators/mobile_workflow/install/templates/app/helpers/application_helper.rb
mobile_workflow-0.7.9 lib/generators/mobile_workflow/install/templates/app/helpers/application_helper.rb
mobile_workflow-0.7.8 lib/generators/mobile_workflow/install/templates/app/helpers/application_helper.rb