title: Rails PATCH Method Not Working
body: <p>I'm using an AJAX call to patch a rails database. The update controller receives the call and looks up the element id in the database, but doesn't actually update it with the new attributes. It then sends a success message to the AJAX without logging any error. Any ideas?</p>
  
  <p>Ajax:</p>
  
  <pre class="lang-js prettyprint-override"><code>eventResizeStop: function(event){
      $.ajax({
          type: "PATCH",
          url: "/appointments/"+event.id,
          data: { appointment: { end_time: event.end.format()} },
          success: function(data){
          },
          error: function(xhr){
              var errors = $.parseJSON(xhr.responseText).errors;
          }
      });
  }
  </code></pre>
  
  <p>Rails controller:</p>
  
  <pre class="lang-ruby prettyprint-override"><code>def update
    @appointment = Appointment.find(params[:id])
    if @appointment.update_attributes(appt_params)
      render nothing: true
      Rails.logger.info(@appointment.errors.full_messages)
    else
      render json: {errors: @appointment.errors.full_messages }, status: 422
    end
  end
  </code></pre>
  
  <p>Output:</p>
  
  <pre class="lang-none prettyprint-override"><code>Started PATCH "/appointments/2" for 199.94.1.209 at 2015-01-29 18:28:53 +0000
  Processing by AppointmentsController#update as */*
  Parameters: {"appointment"=&gt;{"end_time"=&gt;"2015-01-30T15:00:00+00:00"}, "id"=&gt;"2"}
  Appointment Load (0.2ms)  SELECT  "appointments".* FROM "appointments" WHERE "appointments"."id" = ? LIMIT 1  [["id", 2]]
  (0.1ms)  begin transaction
  (0.1ms)  commit transaction
  Rendered text template (0.0ms)
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Routes.rb</p>
  
  <pre><code> Rails.application.routes.draw do
    get 'houses/new'
    get 'houses/edit'
    get 'sessions/new'
    root 'static_pages#home'
    get 'about'               =&gt;  'static_pages#about'
    get 'contact'             =&gt;  'static_pages#contact'
    get 'signup'              =&gt;  'users#new'
    get    'login'            =&gt;  'sessions#new'
    post   'login'            =&gt;  'sessions#create'
    delete 'logout'           =&gt;  'sessions#destroy'
    get 'newhouse'            =&gt;  'houses#new'
    resources :users
    resources :houses
    resources :appointments,    only: [:index, :create, :update, :destroy]
  </code></pre>