title: How should I handle edit and update action when I use Form Object?
body: <p>I have following form object to managing complicated nested form.</p>
  
  <p><strong>Form</strong></p>
  
  <pre><code>= simple_form_for(@profile_form, :url =&gt; profiles_path) do |f|
    ...
  </code></pre>
  
  <p><strong>Routes</strong></p>
  
  <pre><code>resources :profiles
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>class ProfilesController &lt; ApplicationController
    def new
      @profile_form = ProfileForm.new
    end
  
    def edit
      @profile_form = ProfileForm.new(params[:id])
    end
  
    def create
      @profile_form = ProfileForm.new
      if @profile_form.submit(params[:profile_form])
        redirect_to @profile_form.profile, notice: 'Profile was successfully created.'
      else
        render action: "new"
      end
    end
  
    def update
      @profile_form = ProfileForm.new(params[:id])
      if @profile_form.submit(params[:profile_form])
        redirect_to @profile_form.profile, notice: 'Profile was successfully updated.'
      else
        render action: "edit"
      end
    end
  end
  </code></pre>
  
  <p><strong>Form Object</strong></p>
  
  <pre><code>class ProfileForm
    include ActiveModel::Validations
    include ActiveModel::Conversion
    extend ActiveModel::Naming
  
    def initialize(profile_id = nil)
      if profile_id
        @profile = Profile.find(profile_id)
        @person = profile.person
      end
    end
    ...
    def submit(params)
      profile.attributes = params.slice(:available_at)
      person.attributes = params.slice(:first_name, :last_name)
  
      if valid?
        profile.save!
        person.save!
        true
      else
        false
      end
    end
    def self.model_name
      ActiveModel::Name.new(self, nil, "Profile")
    end
  
    def persisted?
      false
    end
  end
  </code></pre>
  
  <p>But right now when I'm editing object using this form <code>create</code> action is called.
  How should then I refactor this form? Code below on <code>update</code> creates another Profile object.</p>