Module: ApplicationHelper

Defined in:
lib/generators/mobile_workflow/install/templates/app/helpers/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#bootstrap_class_for(flash_type) ⇒ Object



2
3
4
# File 'lib/generators/mobile_workflow/install/templates/app/helpers/application_helper.rb', line 2

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_messagesObject



6
7
8
9
10
11
# File 'lib/generators/mobile_workflow/install/templates/app/helpers/application_helper.rb', line 6

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