title: Devise if user exists then update
body: <p>I have a user form in another view which works great to create a user. I want people to complete this form though even if they are already a user. </p>
  
  <p>If they are already a user I would like the form to update their location if they enter anything and save. </p>
  
  <p><strong>User Form</strong></p>
  
  <pre><code>&lt;%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %&gt;
  &lt;%= devise_error_messages! %&gt;
  
  &lt;div class="form-group"&gt;
    &lt;%= f.label :location, "Where are you based?" %&gt;&lt;br /&gt;
    &lt;%= f.text_field :location, placeholder: "E.g. London", class: "full-width form-field" %&gt;
  &lt;/div&gt;
  
  &lt;div class="form-group"&gt;
    &lt;%= f.label :email, "What is your email?" %&gt;  
    &lt;%= f.email_field :email, placeholder: "Enter email", class: "full -width form-field" %&gt;
  &lt;/div&gt;
  
  &lt;div class="actions"&gt;
      &lt;%= f.button "GO", class: "btn btn-1R btn-orange full-width", id: "submit_button" %&gt;
  &lt;/div&gt;
  
  &lt;% end %&gt;
  </code></pre>
  
  <p>I thought I could do a <code>before_validation</code> method in the model to check if the user exists and create one if not. Would this be correct?</p>
  
  <pre><code>before_validation :check_user, :on =&gt; :create
  
  def check_user 
      @user = User.where(email: self.email).first
      unless @user.blank?
          @user.update_attributes(:location =&gt; self.location)
          @user.save
      else
          puts 'NEW USER'
      end
  end
  </code></pre>
  
  <p>This is still throwing the 'Email has already been taken' error.</p>
  
  <p>How can i kill the 'create' method and just cause an update method here? Or am I doing this completely wrong?</p>