Rails 4 not changing post method to patch
<p>I am trying to submit a form, but if I just put <code>form_for @classroom</code> I get a "No route matches [POST]" error. </p>

<p>Now with the code posted below, I get the wrong url in the form. If I change the url manually in the browser it goes through, and I guess I could do that via javascript, but... why... is... this... happening..?</p>

<p>Until yesterday everything was working fine. I even tried rolling back to the things I changed but I can't seem to track what is going wrong.</p>

<h2>routes.rb</h2>

<pre><code>patch 'classrooms/:id/update' =&gt; "classrooms#update", as: :update_classroom
resources :classrooms, except: :update
</code></pre>

<h2>form from rails end</h2>

<pre><code>&lt;%= form_for(update_classroom_path(@classroom), method: "patch") do |class_f| %&gt;
</code></pre>

<h2>form in browser</h2>

<pre><code>&lt;form action="/classrooms/23/edit" accept-charset="UTF-8" method="post"&gt;
&lt;input name="utf8" type="hidden" value="✓"&gt;
&lt;input type="hidden" name="_method" value="patch"&gt;
&lt;input type="hidden" name="authenticity_token" value="******"&gt;
</code></pre>

<h2>rake routes</h2>

<pre><code>        absences POST   /absences(.:format)                   absences#create
                 POST   /classrooms/:id/getAbsences(.:format) classrooms#getAbsences
update_classroom PATCH  /classrooms/:id/update(.:format)      classrooms#update
      classrooms GET    /classrooms(.:format)                 classrooms#index
                 POST   /classrooms(.:format)                 classrooms#create
   new_classroom GET    /classrooms/new(.:format)             classrooms#new
  edit_classroom GET    /classrooms/:id/edit(.:format)        classrooms#edit
       classroom GET    /classrooms/:id(.:format)             classrooms#show
                 DELETE /classrooms/:id(.:format)             classrooms#destroy
            root GET    /                                     pages#start
</code></pre>