title: wrong route handling form submission
body: <p>I have an expanded version of the devise edit registration form, and when I submit it instead of being handled by the update method, it is handled by the create method. And I can't figure out why.</p>
  
  <p>When I submit the form in the log I get:</p>
  
  <pre><code>Started POST "/users" for ::1 at 2015-08-05 20:49:28 -0600
  Processing by Users::RegistrationsController#create as HTML
  </code></pre>
  
  <p>in my view this is how I generate my form tag:</p>
  
  <pre><code>form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put,class:"form-horizontal" }) do |f| ... end
  </code></pre>
  
  <p>relevant output from rake routes:</p>
  
  <pre><code>cancel_user_registration GET    /users/cancel(.:format)                 users/registrations#cancel
         user_registration POST   /users(.:format)                        users/registrations#create
     new_user_registration GET    /users/sign_up(.:format)                users/registrations#new
    edit_user_registration GET    /users/edit(.:format)                   users/registrations#edit
                           PATCH  /users(.:format)                        users/registrations#update
                           PUT    /users(.:format)                        users/registrations#update
                           DELETE /users(.:format)                        users/registrations#destroy
  </code></pre>
  
  <p>and the rendered form html:</p>
  
  <pre><code>&lt;form class="form-horizontal" id="edit_user" action="/users" accept-charset="UTF-8" method="post"&gt;
  &lt;input name="utf8" value="✓" type="hidden"&gt;
  &lt;input name="_method" value="put" type="hidden"&gt;
  &lt;input name="authenticity_token" value="snip" type="hidden"&gt;
  ...
  &lt;input name="commit" value="Update" class="btn btn-success" type="submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I just went ahead and started commenting out large swaths of apparently unrelated code and it turned out that the following fields were causing the issue:</p>
  
  <pre><code>&lt;input name="user[doctor_ids][]" value="" type="hidden"&gt;
  &lt;select multiple="multiple" name="user[doctor_ids][]" id="user_doctor_ids"&gt;
    &lt;option value="2"&gt;House&lt;/option&gt;
  &lt;/select&gt;
  &lt;input value="2" name="user[doctor_ids][]" id="user_doctor_ids_2" type="checkbox"&gt;
  &lt;input name="user[doctor_ids][2][token]" id="user_doctor_ids_2_token" type="text"&gt;
  </code></pre>
  
  <p>note the repeated <code>name="user[doctor_ids][]"</code>, still don't know why that was screwing with the routing but at least I can fix it. I was just trying to see what the params looked like when you submitted something like that in each case.</p>