I am using: Ruby version: 2.2 Rails version: 4.2
I am attempting to make use of the asset pipeline in terms of JavaScript, I understand and have working stylesheets, but I cannot separate my js from my view.
Example:
// view.html.erb
<body>
<div id="slider"></div>
</body>
// assets/javascript/slider.js
$( "#slider" ).slider({
min: 0,
max: 10000,
value: 0,
slide: function( event, ui ) {
$( "#SolarAmount" ).val(ui.value + " sq. ft.");
}
});
But the slider is nowhere to be found. However, If I include the function inside the view.html.erb it works as expected. If anyone can offer some advice about how the pipeline works with javascript I would appreciate the help!