module ApplicationHelper

Public Instance Methods

content_menu(selected_section) click to toggle source
# File lib/engine/app/helpers/application_helper.rb, line 12
def content_menu(selected_section)
  capture_haml do
    haml_tag :ul, class: 'nav navbar-nav' do
      section(name: 'info', title: 'Info', url: info_index_path, selected_section: selected_section)
      section(name: 'content', title: 'Content', url: content_index_path, selected_section: selected_section)
      section(name: 'tasks', title: 'Tasks', url: tasks_path, selected_section: selected_section)
      section(name: 'notifications', title: 'Notifications', url: notifications_path, selected_section: selected_section)
      section(name: 'performance', title: 'Performance', url: performance_index_path, selected_section: selected_section)
    end
  end
end
edit_class() click to toggle source
# File lib/engine/app/helpers/application_helper.rb, line 28
def edit_class
  'btn btn-primary'
end
redis_configuration_string() click to toggle source
# File lib/engine/app/helpers/application_helper.rb, line 32
def redis_configuration_string
  "#{backend.host}:#{backend.port}"
end
remove_class() click to toggle source
# File lib/engine/app/helpers/application_helper.rb, line 24
def remove_class
  'btn btn-danger'
end
section(opts = {}) click to toggle source
# File lib/engine/app/helpers/application_helper.rb, line 6
def section(opts = {})
  haml_tag :li, class: selected_is_selected(opts[:name], opts[:selected_section]) do
    haml_tag :a, opts[:title], href: opts[:url]
  end
end
selected_is_selected(section, selected) click to toggle source
# File lib/engine/app/helpers/application_helper.rb, line 2
def selected_is_selected(section, selected)
  'active' if section == selected
end