-
Notifications
You must be signed in to change notification settings - Fork 233
Use my own chosen patch
tsechingho edited this page Sep 17, 2012
·
1 revision
You hack some official chosen javascripts, but don't want to create another gem for this patch, and just want to put this patch to specific rails project. Do it as following steps.
- create a folder
app/assets/javascripts/chosen
, and put all your hacked coffee scripts / javascripts of chosen into it. ex:
app/assets/javacripts/chosen/hacked.chosen.jquery.coffee
- create a
app/assets/javascripts/my-chosen-jquery.js
to require all official scripts, except the one you hacked, and all your hacked scripts, ex:
//= require lib/abstract-chosen
//= require lib/select-parser
//# require chosen.jquery
//= require chosen/hacked.chosen.jquery
- instead of requiring
chosen-jquery
javascript provided bychosen-rails
, require above javascript file in yourapp/assets/javascripts/application.js
, ex:
//# require chosen-jquery
//= require my-chosen-jquery
That's all.