module ApplicationHelper

Public Instance Methods

bootstrap_class_for(flash_type) click to toggle source
# File lib/generators/mobile_workflow/install/templates/app/helpers/application_helper.rb, line 3
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
flash_messages() click to toggle source
# File lib/generators/mobile_workflow/install/templates/app/helpers/application_helper.rb, line 7
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