Class: Main

Inherits:
Application show all
Defined in:
app/controllers/main.rb

Instance Method Summary collapse

Methods inherited from Application

#access_denied, #admin_or_requesting_node, #authenticate_every, #display, #get_available_recipes, #is_admin, #is_admin_or_validator, #redirect_back_or_default, #store_location

Instance Method Details

#indexObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/main.rb', line 5

def index
  case content_type
  when :json
    display absolute_url(:nodes) => "Manage Nodes",
            absolute_url(:roles) => "Manage Roles",
            absolute_url(:cookbooks) => "Manage Cookbooks",
            absolute_url(:data) => "Manage Data Bags",
            absolute_url(:search) => "Search"
  else
    @webui_url = if Chef::Config[:chef_webui_url]
      Chef::Config[:chef_webui_url]
    elsif request.host =~ /(.*):4000/
      absolute_url(:top, :host => "#{$1}:4040")
    else
      nil
    end
    render
  end
end