I have a rails application that I’ve added jquery datepicker to a date field.
It is working ok for some uses – it appears ok, I can pick a date and it gets saved to the database ok. The next time I visit the page (or if I check the database separately) the field has changed value correctly.
However one thing that is not working correctly is that when I click on the date field for an existing record, the calendar pop-up still has todays date/month, not the month that is actually in the database field, as in:

How can I get the pop-up to come up ‘on’ the month that is actually in the databse?
My view code:
= f.text_field :content_date, id: 'datepicker', size:10
My js code (public/application.js):
//= require jquery
// jQueryUI Date Picker:
$(function (){
$(".datepick").datepicker({ dateFormat: 'yy-mm-dd'});
});
I am running rails 3.0.10
You can parse the value of the text input with javascript, and initialize the date picker with the parsed date. Try with: