title: Implementing jwilhem's slider on a Mapbox map in Rails
body: <p>Trying to implement <a href="https://github.com/dwilhelm89/LeafletSlider" rel="nofollow noreferrer">D Wilhem's Leaflet Slider</a>, a front end to the <a href="http://jqueryui.com/slider/" rel="nofollow noreferrer">JQuery UI slider</a> in Rails. I get the error <code>ReferenceError: Can't find variable: L</code>. I've looked at lots of discussions and imagine I've mixed up my syntax. The page loads and 1) my data shows up, 2) the slider control shows up, but the slider doesn't function and I get then aforementioned error. </p>
  
  <pre><code> function makeMap() {
     L.mapbox.accessToken = $('body').data("mapboxToken");
  
     var map = L.mapbox.map('map', 'mtnbiker.d7jfhf8u') // Was: mapbox.streets
                .setView([34.040951, -118.258579], 13);
  
     L.control.fullscreen().addTo(map);
  
     var featureLayer = L.mapbox.featureLayer()
                       .loadURL('map/point_data.geojson')
                       .addTo(map);
  
     var featureLayer = L.mapbox.featureLayer()
                          .loadURL('map/line_data.geojson')
                           .addTo(map);
  
     var sliderControl = L.control.sliderControl({range: true, alwaysShowDate: true, timeStrLength: 10, layer: featureLayer});
  
     map.addControl(sliderControl); 
  
     sliderControl.startSlider();
  
     $('#slider-timestamp').html(options.markers[ui.value].feature.properties.time.substr(0, 10)); 
  
     featureLayer.on('ready', function(e) {
       map.fitBounds(featureLayer.getBounds());
     });
    }
  </code></pre>
  
  <p><code>application.js</code>:</p>
  
  <pre><code>//= require jquery
  //= require jquery_ujs
  //= require bootstrap
  //= require turbolinks
  //= require 'leaflet.js'
  //= require leaflet
  //= require_tree .
  </code></pre>
  
  <h2>The map loads with data (points and lines) and non-functioning slider at localhost. Points are loading at Heroku, but not the lines nor slider.  <a href="https://secure-shore-68966.herokuapp.com/map" rel="nofollow noreferrer">https://secure-shore-68966.herokuapp.com/map</a>.</h2>
  
  <p>Answer:
  After weeks of trying different things, a friend from MaptimeLA was able to sit down with me at a meeting and found a type. She is very familiar with Rails and debugging. 
  application.js was:</p>
  
  <pre><code>//  require jquery.ui
  //  require jquery.ui.widget
  </code></pre>
  
  <p>Fixed</p>
  
  <pre><code>//= require jquery-ui
  //= require jquery.ui.widget
  </code></pre>
  
  <p>Thanks to all who chimed in.</p>
  
  <p>All the code is at <a href="https://bitbucket.org/MtnBiker/crores5/" rel="nofollow noreferrer">https://bitbucket.org/MtnBiker/crores5/</a>.</p>
  
  <p>PS. I can't see the checkbox to say I want to answer my own question. </p>