Module: Para::FlashHelper

Defined in:
app/helpers/para/flash_helper.rb

Instance Method Summary collapse

Instance Method Details

#flash_partial_pathObject



3
4
5
# File 'app/helpers/para/flash_helper.rb', line 3

def flash_partial_path
  template_path_lookup('admin/shared/_flash', 'para/admin/shared/_flash')
end

#homogenize_flash_type(type) ⇒ Object

Converts flash types to :success or :error to conform to what twitter bootstrap can handle



10
11
12
13
14
15
16
17
# File 'app/helpers/para/flash_helper.rb', line 10

def homogenize_flash_type(type)
  case type.to_sym
  when :notice then :success
  when :alert then :warning
  when :error then :danger
  else type
  end
end

#icon_class_for(type) ⇒ Object



19
20
21
22
23
24
25
# File 'app/helpers/para/flash_helper.rb', line 19

def icon_class_for(type)
  case type
  when :success then 'fa-check'
  when :error then 'fa-warning'
  else 'fa-exclamation-triangle'
  end
end