title: jQuery Datepicker with Rails 4
body: <p>I'm using jQuery Datepicker gem and when I'm editing a record that has a date it it behaves unexpectedly. </p>
  
  <p>When I create a new record the date is entered with the mm/dd/yy format.  When I go to edit the record the date is being populated in the date field in the format yyyy-dd-mm and I have no idea why. Perhaps this is something to do with Rails itself?</p>
  
  <p>The Date column in the table is set to Date, which I would imagine is fine. Is there something that I need to do in my view when displaying the date or something in the controller?</p>
  
  <p>This is what is in my application.js file:</p>
  
  <pre><code>$(document).on('page:change', function () {
          $('#cust_dob').datepicker({
              changeMonth: true,
              changeYear: true,
              dateFormat: "mm/dd/yy",
              yearRange:  "1900:+0"
      });
  });
  </code></pre>
  
  <p>Any help would be much appreciated.</p>