Module: Prosperity::ApplicationHelper

Defined in:
app/helpers/prosperity/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#app_nameObject



3
4
5
# File 'app/helpers/prosperity/application_helper.rb', line 3

def app_name
  "Prosperity" 
end

#body_classObject



11
12
13
# File 'app/helpers/prosperity/application_helper.rb', line 11

def body_class
  "#{params[:controller]}-#{params[:action]}".gsub(/\//, '-')
end


7
8
9
# File 'app/helpers/prosperity/application_helper.rb', line 7

def link_to_metric(metric)
  link_to metric.new.title, metric_path(id: metric.name)
end


15
16
17
18
19
20
21
22
23
24
25
# File 'app/helpers/prosperity/application_helper.rb', line 15

def navbar_item(name, url, *controllers)
  classes = []

  if controllers.any?{ |c| controller.is_a?(c) }
    classes << 'active'
  end

  (:li, class: classes) do
    link_to name, url
  end
end