I want to include this, for example:
jQuery(document).ready(function($) {
$(\'#my-modal\').modal(options)
});
In one specific place in
jquery-readyselector is a plugin that "Extends $().ready()
to provide a convenient syntax for page-specific script"
Install jquery-readyselector
Create some CSS classes
Scope your javascript to your page
$("#my-modal").ready(function() {
$('#my-modal').modal(options)
});
More info in this answer How to load page specific rails 4 js files?