title: undefined method `each' for nil:NilClass for display on application.html.erb
body: <p>I am trying to get a customized dropdown menu on my app so that each of my <code>list</code> instances have their own link on the navigation.  So far here's my <code>application.html.erb</code>:</p>
  
  <pre><code>         &lt;li class="dropdown"&gt;
              &lt;a href="/lists" class="dropdown-toggle" data-toggle="dropdown"&gt;My Lists&lt;b class="caret"&gt;&lt;/b&gt;&lt;/a&gt;
              &lt;ul class="dropdown-menu"&gt;
                &lt;li&gt;&lt;%= link_to "All Lists", lists_path %&gt;&lt;/li&gt;
                &lt;% @lists.each do |list|%&gt;
                  &lt;li&gt;&lt;%= link_to list_path(list) do %&gt;
                    &lt;%= list.name %&gt;
                  &lt;% end %&gt;&lt;/li&gt;
                &lt;% end %&gt;
              &lt;/ul&gt;
            &lt;/li&gt;
  </code></pre>
  
  <p>However, I now get an error that says <code>undefined method 'each' for nil:NilClass</code> on the line with <code>@lists.each do |list|</code>. I know this (or a similar) structure works on another page, so I'm thinking it must have something to do with the controllers.  My <code>lists_controller</code> performs this action correctly on my <code>lists#index</code> page with these definitions:</p>
  
  <pre><code>class ListsController &lt; ApplicationController
    def index
      @lists = List.all
      @list = List.new
    end
  ...
  </code></pre>
  
  <p>And I have this in my <code>application_controller</code> currently to mirror that:</p>
  
  <pre><code>def application
    @lists = List.all
    @list = List.new
  end
  </code></pre>
  
  <p>But I'm pretty sure that's not right. What should I have in my <code>application_controller</code> to get it to recognize this in my menu on all the pages?</p>