Module: Prosperity::ApplicationHelper
- Defined in:
- app/helpers/prosperity/application_helper.rb
Instance Method Summary collapse
- #app_name ⇒ Object
- #body_class ⇒ Object
- #link_to_metric(metric) ⇒ Object
- #navbar_item(name, url, *controllers) ⇒ Object
Instance Method Details
#app_name ⇒ Object
3 4 5 |
# File 'app/helpers/prosperity/application_helper.rb', line 3 def app_name "Prosperity" end |
#body_class ⇒ Object
11 12 13 |
# File 'app/helpers/prosperity/application_helper.rb', line 11 def body_class "#{params[:controller]}-#{params[:action]}".gsub(/\//, '-') end |
#link_to_metric(metric) ⇒ Object
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 |
#navbar_item(name, url, *controllers) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/helpers/prosperity/application_helper.rb', line 15 def (name, url, *controllers) classes = [] if controllers.any?{ |c| controller.is_a?(c) } classes << 'active' end content_tag(:li, class: classes) do link_to name, url end end |