title: undefined method `each' for nil:NilClass, render other model on defferent view
body: <p>I'm using mongoid and did't add any code after generated plain scaffold..<br>
  I'd like to render list of category on portfolio index view page.. <br>
  so i rendered as partial. but got error as below..</p>
  
  <pre><code>NoMethodError in Portfs#index
  
  Showing /Users/suri/Dev/action2/app/views/cats/_list.html.erb where line #1 raised:
  
  undefined method `each' for nil:NilClass
  Extracted source (around line #1):
  
  1: &lt;% @cats.each do |cat| %&gt;
  2:  &lt;li&gt;&lt;%= cat.name %&gt;&lt;/li&gt;
  3: &lt;% end %&gt;
  </code></pre>
  
  <p>view/portf/index.html.erb</p>
  
  <pre><code>&lt;div class="row"&gt;
    &lt;div class="span9"&gt;
      &lt;div class="row"&gt;
          &lt;ul class="thumbnails"&gt;
          &lt;% @portfs.each do |portf| %&gt;
              &lt;li class="span3"style="border:1px solid black;"&gt;
              &lt;div class="thumbnail"&gt;
                  &lt;% portf.images.each do |image| %&gt;
                      &lt;%= image_tag image.file.url(:small) %&gt;
                  &lt;% end %&gt;
                  &lt;div class="caption"&gt;
                  &lt;h3&gt;&lt;%= link_to (truncate portf.title, :length =&gt;10), portf %&gt;&lt;/h3&gt;
                  &lt;p&gt;&lt;%= truncate portf.decs, :length =&gt; 30 %&gt;&lt;/p&gt;
                  &lt;p&gt;&lt;%= link_to 'Edit', edit_portf_path(portf) %&gt;
                  &lt;%= link_to 'Destroy', portf, method: :delete, data: { confirm: 'Are you sure?' } %&gt;&lt;/p&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;/li&gt;
          &lt;% end %&gt;
          &lt;/ul&gt;
    &lt;/div&gt;
    &lt;/div&gt;
  
      &lt;div class="span3"&gt;
          &lt;div class="modal fade" id="portf_modal"&gt;
              &lt;div class="modal-header"&gt;
                  &lt;a class="close" data-dismiss="modal"&gt;&amp;times;&lt;/a&gt;
                  &lt;h3&gt;Welcom to &lt;%= image_tag 'logo.png', :height =&gt; 12 %&gt;&lt;/h3&gt;
              &lt;/div&gt;
              &lt;div class="modal-body"&gt;
                  &lt;%= form_for :portf, :html =&gt; { :multipart =&gt; true } do |f| %&gt;
                  &lt;div class="field"&gt;
                  &lt;%= f.label :title %&gt;&lt;br /&gt;
                  &lt;%= f.text_field :title %&gt;
                  &lt;/div&gt;
  
                  &lt;%= f.label :Category %&gt;&lt;br /&gt;
                  &lt;%= collection_select(:portf, :category, Cat.all, :name, :name) %&gt;
  
                  &lt;div class="field"&gt;
                  &lt;%= f.label :decs %&gt;&lt;br /&gt;
                  &lt;%= f.text_area :decs, :class =&gt; 'span5', :rows =&gt; 10 %&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="modal-footer"&gt;
                  &lt;%= f.submit '올리기', :class =&gt; 'btn btn-primary'  %&gt;
                  &lt;a href="#" class="btn" data-dismiss="modal"&gt;닫기&lt;/a&gt;
                  &lt;% end %&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;form class="form-search"&gt;
              &lt;div class="input-append"&gt;
              &lt;input type="text" class="span2 search-query"&gt;
              &lt;button type="submit" class="btn"&gt;Search&lt;/button&gt;
              &lt;/div&gt;
          &lt;/form&gt;
  
          &lt;p&gt;category&lt;/p&gt;
          &lt;% render 'cats/list', :action =&gt; "index", :controller =&gt; "cats" %&gt;
  
  
          &lt;a href="#portf_modal" data-toggle="modal" class="btn btn-primary"&gt;포트폴리오 올리기&lt;/a&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>view/cats/_list.html.erb</p>
  
  <pre><code>&lt;% @cats.each do |cat| %&gt;
      &lt;li&gt;&lt;%= cat.name %&gt;&lt;/li&gt;
  &lt;% end %&gt;
  </code></pre>