Datepicker is not working

I am using Ruby 1.9.3 and Rails 3.2.16.

I want to add the datepicker widget to one of my select fields. I have
included 'jquery_datepicker', 'jquery-rails', 'jquery-ui-rails' in
Gemfile.
I am new for JQuery.

The form code like as follow:

<div class="field">
    <%= f.label :expense_on %><br />
    <%= f.text_field :expense_on, :id => "datepicker" %>
</div>

Code for application.js :

//= require jquery
//= require jquery-ui
//= require jquery_ujs
//= require bootstrap
//= require_tree .

$(function() {
  $('#datepicker').datepicker({dateFormat: 'yy-mm-dd'});
});

code for application.css:

/*
*= require_self
*= require jquery-ui
*= require_tree .
*/

I am not getting any error.

I attached application.html.erb. Please find it.

How could i fix this problem?

Kind regards.

Attachments:
http://www.ruby-forum.com/attachment/9916/application.html.erb

I have solved this problem.

Thanks for sharing the solution so that others can learn from it.

Colin

I have solved this problem.

I have changed application.html.erb file. I attached updated file of
application.html.erb, Please find it.

I have add code in **quantities.js.coffee** like as follow:

jQuery ->
  $('.datepicker').datepicker()

Kind regards.

Attachments:
http://www.ruby-forum.com/attachment/9917/application.html.erb

Thanks for sharing the solution so that others can learn from it.

Thank you for your suggestion. I have shared my solution.

Kind regards.