0

I would like to use the jQuery UI Datepicker plugin in my Rails 3 application.

I thought to put it in vendor/plugins/ directory. (Is there a better place ?)

I tried to import the JS file like that:

<%= javascript_include_tag '/vendor/plugins/jquery-ui-1.8.9-datepicker/js/jquery-ui-1.8.9.custom.min.js' %>

but it does not recognize the path.

How should I do this ?

Misha Moroshko
  • 166,356
  • 226
  • 505
  • 746

1 Answers1

1

To serve the javascripts, they will need to be placed in public/

If you place the file itself in public/javascripts/ it can be referenced with:

<%= javascript_include_tag 'jquery-ui-1.8.9.custom.min.js' %>

Don't forget to include Jquery and JqueryUI javascripts for this JS plugin to work.

seeingidog
  • 1,166
  • 9
  • 5