title: How to move script in a view to a separate js file in Ruby On Rails?
body: <p>I am using:
  Ruby version: 2.2 Rails version: 4.2</p>
  
  <p>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. </p>
  
  <p>Example:</p>
  
  <pre><code>// view.html.erb 
  &lt;body&gt; 
    &lt;div id="slider"&gt;&lt;/div&gt; 
  &lt;/body&gt; 
  
  
  // assets/javascript/slider.js
  $( "#slider" ).slider({
    min: 0,
    max: 10000,
    value: 0,
    slide: function( event, ui ) {
      $( "#SolarAmount" ).val(ui.value + " sq. ft.");
    }
  });
  </code></pre>
  
  <p>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!</p>