Module: ApplicationHelper

Defined in:
lib/generators/happy_seed/bootstrap/templates/app/helpers/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#flash_class(level) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/generators/happy_seed/bootstrap/templates/app/helpers/application_helper.rb', line 2

def flash_class(level)
  case level.to_sym
    # allow either standard rails flash category symbols...
    when :notice then "info"
    when :success then "success"
    when :alert then "warning"
    when :error then "danger"
    # ... or bootstrap class symbols
    when :info then "info"
    when :warning then "warning"
    when :danger then "danger"
    # and default to being alarming
    else "danger"
  end
end

#page_titleObject



18
19
20
# File 'lib/generators/happy_seed/bootstrap/templates/app/helpers/application_helper.rb', line 18

def page_title
  @title || controller_name.gsub( /Controller/, "" ).humanize
end