ruby-on-railsselectize.jsrails-assets

How do I use Rails Selectize in my Rails Project?


I'm getting the error

Selectize: Dependency MicroPlugin is missing

Make sure you either: (1) are using the "standalone" version of Selectize, or (2) require MicroPlugin before you load Selectize.

application.js:

//= require jquery
//= require jquery_ujs
//= require selectize
//= require turbolinks
//= require bootstrap-sprockets
//= require jquery.validate
//= require jquery.validate.additional-methods
//= require_tree .

Solution

  • I changed my application.js to

    //= require selectize/standalone/selectize
    

    I figured it out by looking at the load paths

    ~/.rvm/gems/ruby-2.3.1/gems/rails-assets-selectize-0.12.3/app/assets/javascripts
    

    and found standalone was in /selectize/standalone/selectize.js

    I knew to look there by looking at their examples.