Reputation: 3988
I'm guessing this is a silly question, but i'm a bit of a newb... I've added the chosen gem to my rails app by adding it to my Gemfile and requiring chosen-jquery in my application.js file.
My question is: where can i find the actual javascript file for chosen? Is it downloading it automatically?
Upvotes: 0
Views: 254
Reputation: 1000
Look up your assets load path. Like this:
Your chosen-jquery is in one of those folders.
Upvotes: 0
Reputation: 2716
Simply include the JS and CSS files like described in the documentation on the main page of the Github project and it will be included when precompiling your assets. The files are not within your project directory but rather within the gem and will be resolved by the pipeline when the gem is included.
If you need to get to the file directly (for modifications), you need to put the JS in there manually. You can then still include it in the main application.js for the pipeline and have better control of the version in use. To me, this is the preferred method.
However, may I suggest switching to Select2 which is originally based on Chosen but under much more active development and better documentation:
http://ivaynberg.github.io/select2/
https://github.com/ivaynberg/select2
There's also a gem for it if you like: https://github.com/argerim/select2-rails
Upvotes: 1
Reputation: 51171
It's in a gem itself. If you look at vendor/assets/javascripts
in gem root, you'll see all javascripts that come with chosen gem. They are added by assets pipeline, with
//= require chosen-jquery
line in your application.js
.
Upvotes: 0