title: How to use an adapter in ember
body: <p>I am trying to send data from my front end ember app to a rails API. The method in question, donate, sits at a custom route:</p>
  
  <p><code>patch 'accounts/:id/donate' =&gt; 'accounts#donate'</code></p>
  
  <p>In order to call to it, I understand that my ember route needs to use an adapter to override the normal patch methods, but that is about where my knowledge ends. This is the state of my current route:</p>
  
  <pre><code>import Ember from 'ember';
  
  export default Ember.Route.extend({
  
    actions: {
      donate(params){
        console.log('hits');
        console.log(params);
        let patron = this.get('store').findRecord('account', 10);
        // here is where I need to link to my adapter
        patron.donate(params);
      }
    }
  });
  </code></pre>
  
  <p>and my adapter file (I cannot even get this to fire yet, so the low quality of the code is to be expected):</p>
  
  <pre><code>import ApplicationAdapter from './application';
  
  export default ApplicationAdapter.extend({
    // Not super confident about this adapter, not am I super confident about how I
    // am passing data through it.
    donate(store, type, record) {
      let api = this.get('host');
      let serialized = this.serialize(record, {includeId: true});
      let accountId = serialized.account_id;
      let url = `${api}/accounts/${accountId}/donate`;
      let data = {account: serialized};
      return this.ajax(url, 'PATCH', {data});
    }
  });
  </code></pre>
  
  <p>The first step to getting this functionality working is making sure my adapter can properly call to my server. How/where would I go about making this happen?</p>