title: How to format the date field when making a POST request to Rails API
body: <p>I am adding a series of data to my rails application through a POST request to the API.</p>
  
  <p>All is working well, however, whenever I try and add data to a date field, I get the following error:</p>
  
  <pre><code>&gt; undefined method `year' for nil:NilClass
  </code></pre>
  
  <p>Here is an example of my JSON payload:</p>
  
  <pre><code>{
      "product": {
          "name": "Foo",
          "start_date": "2015-11-05 22:32:03"
      }
  }
  </code></pre>
  
  <p>I know there is a potential bug with this relating to Ruby 2.2 .. however when I looked at the backend for how the params were stored on a normal create action through the frontend, they were stored a lot differently:</p>
  
  <pre><code>"start_date(1i)"=&gt;"2020", "start_date(2i)"=&gt;"1", "start_date(3i)"=&gt;"1", "start_date(4i)"=&gt;"00", "start_date(5i)"=&gt;"01"
  </code></pre>
  
  <p>How would I recreate this?</p>