title: undefined method `model_name' error
body: <p>I keep getting this strange error, even though everything works on localhost.</p>
  
  <pre><code>  1) User pages profile page 
       Failure/Error: before { visit user_path(user) }
       ActionView::Template::Error:
         undefined method `model_name' for NilClass:Class
       # ./app/views/shared/_create_list.html.erb:2:in `_app_views_shared__create_list_html_erb__3760252191913263716_70266394394440'
       # ./app/views/users/show.html.erb:17:in `_app_views_users_show_html_erb__4038196524711190952_70266368588040'
       # ./spec/requests/user_pages_spec.rb:12:in `block (3 levels) in &lt;top (required)&gt;'
  </code></pre>
  
  <p>users_controller</p>
  
  <pre><code>class UsersController &lt; ApplicationController
    before_filter :signed_in_user, only: [:edit, :update]
    before_filter :correct_user,   only: [:edit, :update]
  
    def show
      @user = User.find(params[:id])
      @lists = @user.lists
      @list = current_user.lists.build if signed_in?
    end
  </code></pre>
  
  <p>lists_controller</p>
  
  <pre><code>class ListsController &lt; ApplicationController
    before_filter :signed_in_user
  
    def create
      @list = current_user.lists.build(params[:list])
      if @list.save
        flash[:success] = "List created!"
        redirect_to current_user
      else
        redirect_to current_user
      end
    end
  </code></pre>
  
  <p>_create_list partial</p>
  
  <pre><code>&lt;div class="white-box"&gt;
  &lt;%= form_for(@list) do |f| %&gt;
    &lt;%= render 'shared/error_messages', object: f.object %&gt;
    &lt;div class="field"&gt;
      &lt;%= f.text_field :name, placeholder: "Create new list..." %&gt;
      &lt;%= f.submit "Create list", class: "btn btn-primary" %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>users/show</p>
  
  <pre><code>  &lt;div class="span8"&gt;
      &lt;% if @user.lists.any? %&gt;
        &lt;h3&gt;Lists (&lt;%= @user.lists.count %&gt;)&lt;/h3&gt;
        &lt;ol class="lists"&gt;
          &lt;%= render @lists %&gt;
        &lt;/ol&gt;
      &lt;% end %&gt;
      &lt;%= render 'shared/create_list' %&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>user_pages_spec</p>
  
  <pre><code>require 'spec_helper'
  
  describe "User pages" do
  
    subject { page }
  
    describe "profile page" do
      let(:user) { FactoryGirl.create(:user) }
      let!(:m1) { FactoryGirl.create(:list, user: user, name: "Foo") }
      let!(:m2) { FactoryGirl.create(:list, user: user, name: "Bar") }
  
      before { visit user_path(user) }
  </code></pre>
  
  <p>I am very new to rails and this error has been haunting me for days! Any suggestions are much appreciated! </p>