title: What is the difference between the build and create method in ActiveRecord relations?
body: <p>I have a User who can have 0 or 1 Profiles. In my Controller, I want to save the profile if some of the values are given, as follows:</p>
  
  <pre><code># PUT /users/1
  def update
    @user = User.find(params[:id])
  
    if @user.update_attributes(params[:user])
      if params[:profile][:available] == 1 #available is a checkbox that stores a simple flag in the database.
        @user.create_profile(params[:profile])
      end
    else 
      #some warnings and errors
    end
  end
  </code></pre>
  
  <p>The part I am wondering about is <code>create_profile</code>, the magic <code>create_somerelationname</code>. How does that compare to the magic <code>build_somerelationname</code>? And when should I use which?</p>