title: Undefined method 'build' in rails 3
body: <p>I am getting a "NoMethodError in ProjectsController#create" with the following code:</p>
  
  <pre><code>def create
    @project = current_user.project.build(params[:project])
    if @project.save
      flash[:success] = "Project created!"
      redirect_to root_url
    end
  end
  </code></pre>
  
  <p>I have tried using <code>@project = current_user.project.create(params[:project])</code> as well, but I get the same error, albeit for <code>.create</code>.</p>
  
  <p>My Project model looks like this:</p>
  
  <pre><code>class Project &lt; ActiveRecord::Base
    attr_accessible :title,
                    :sub_title,
                    :desc,
                    :category
  
    validates :user_id, presence: true
    validates :title, presence: true, length: { maximum: 35 }
    validates :category, presence: true
  
    belongs_to  :user
    ...
  end
  </code></pre>
  
  <p>and my User model looks like this:</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    attr_accessible :name,
                    :surname,
                    :email,
                    :email_confirmation,
                    :password,
                    :password_confirmation
  
    has_secure_password
  
    has_one :project
    ...
  end
  </code></pre>
  
  <p>From what I can tell, this should create a new Project with an association to the <code>user.id</code> and <code>project.user_id</code>.  Any ideas why I get the error instead of successful creation?</p>