When I first time load my page, select2 will work properly... But if I go to other links, we wouldn't be able to see select2 unless we reload the page.
Here's my code:
Gemfile:
gem 'turbolinks', '~> 5.0.0'
gem "select2-rails"
application.js:
//= require turbolinks
//= require select2
application.css:
*= require select2
index.html.erb:
<script>
$(document).ready(function() { $("#e1").select2(); });
</script>