<!DOCTYPE html>
<html ng-app="hyperadmin">
  <head>
    <title>HyperAdmin</title>

    <%= stylesheet_link_tag "//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" %>
    <%= stylesheet_link_tag    "hyper_admin/application", media: :all %>
    <%= javascript_include_tag "hyper_admin/application" %>

    <%= csrf_meta_tags %>
  </head>
  <body ng-controller="MainCtrl">

    <nav class="navbar navbar-default">
      <div class="container-fluid">
        <div class="navbar-header">
          <a class="navbar-brand" href="/admin">Admin</a>

          <ul class="nav navbar-nav">
            <% @resource_classes.each do |resource_class| %>
              <li class="<%= "active" if params[:controller] == "admin/#{resource_class.model_name.plural}" %>">
                <%= link_to resource_class.model_name.human(count: 2), [ :admin, resource_class ] %>
              </li>
            <% end %>
          </ul>
        </div>
      </div>
    </nav>

    <div class="container-fluid">
      <div class="row">
        <div class="col-xs-12">
          <% flash.each do |kind, message| %>
            <aside class="alert alert-<%= kind %>">
              <%= message %>
            </aside>
          <% end %>
        </div>
      </div>

      <ui-view></ui-view>
    </div>

  </body>
</html>

<!DOCTYPE html>
<html ng-app="hyperadmin">
  <head>
    <title>HyperAdmin</title>

    <%= stylesheet_link_tag "//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" %>
    <%= stylesheet_link_tag    "hyper_admin/application", media: :all %>
    <%= javascript_include_tag "hyper_admin/application" %>

    <%= csrf_meta_tags %>
  </head>
  <body ng-controller="MainCtrl as mainCtrl">

    <nav class="navbar navbar-default">
      <div class="container-fluid">
        <div class="navbar-header">
          <a class="navbar-brand" href="/admin">Admin</a>

          <ul class="nav navbar-nav">
            <% @resource_classes.each do |resource_class| %>
              <li class="<%= "active" if params[:controller] == "admin/#{resource_class.model_name.plural}" %>">
                <%= link_to resource_class.model_name.human(count: 2), [ :admin, resource_class ] %>
              </li>
            <% end %>
          </ul>
        </div>
      </div>
    </nav>

    <div class="container-fluid">
      <div class="row">
        <div class="col-xs-12">
          <% flash.each do |kind, message| %>
            <aside class="alert alert-<%= kind %>">
              <%= message %>
            </aside>
          <% end %>
        </div>
      </div>

      <ui-view></ui-view>
    </div>

  </body>
</html>

Use "controller as" syntax for MainCtrl in layout
Use "controller as" syntax for MainCtrl in layout
