title: Devise Custom Update Controller
body: <p>I'm using Devise for my authentication/registration. I have an edit user page, which devise has generated for me that looks like this: </p>
  
  <pre><code>&lt;h2&gt;Edit &lt;%= resource_name.to_s.humanize %&gt;&lt;/h2&gt;
  
  &lt;%= form_for(resource, :as =&gt; resource_name, :url =&gt; registration_path(resource_name), :html =&gt; { :method =&gt; :put }) do |f| %&gt;
    &lt;%= devise_error_messages! %&gt;
  
    &lt;div&gt;&lt;%= f.label :email %&gt;&lt;br /&gt;
    &lt;%= f.email_field :email, :autofocus =&gt; true %&gt;&lt;/div&gt;
  
    &lt;% if devise_mapping.confirmable? &amp;&amp; resource.pending_reconfirmation? %&gt;
      &lt;div&gt;Currently waiting confirmation for: &lt;%= resource.unconfirmed_email %&gt;&lt;/div&gt;
    &lt;% end %&gt;
  
    &lt;div&gt;&lt;%= f.label :password %&gt; &lt;i&gt;(leave blank if you don't want to change it)&lt;/i&gt;&lt;br /&gt;
    &lt;%= f.password_field :password, :autocomplete =&gt; "off" %&gt;&lt;/div&gt;
  
    &lt;div&gt;&lt;%= f.label :password_confirmation %&gt;&lt;br /&gt;
    &lt;%= f.password_field :password_confirmation %&gt;&lt;/div&gt;
  
    &lt;div&gt;&lt;%= f.label :current_password %&gt; &lt;i&gt;(we need your current password to confirm your changes)&lt;/i&gt;&lt;br /&gt;
    &lt;%= f.password_field :current_password %&gt;&lt;/div&gt;
  
    &lt;div&gt;&lt;%= f.submit "Update" %&gt;&lt;/div&gt;
  &lt;% end %&gt;
  
  &lt;h3&gt;Cancel my account&lt;/h3&gt;
  
  &lt;p&gt;Unhappy? &lt;%= button_to "Cancel my account", registration_path(resource_name), :data =&gt; { :confirm =&gt; "Are you sure?" }, :method =&gt; :delete %&gt;&lt;/p&gt;
  
  &lt;%= link_to "Back", :back %&gt;
  </code></pre>
  
  <p>The issue is that my "user" has more fields than devise has generated for me, and I want to pass those in as well as handle various scenarios created by user actions on the front end. Basically, I need to customize whatever Devise is doing behind the scenes when I click "Update" to submit the form. </p>
  
  <p>How could I either override the Devise controller to implement what I need, or have the submit button route to a different update controller that has the actions I need? </p>
  
  <p>Here are my routes (brokers and renters are both a type of user, synonymous for these purposes):</p>
  
  <p>devise_for :brokers
  devise_for :renters</p>