title: Rails link_to not loading leaflet map
body: <p>I've come across a really strange (at least to me) issue.  When I type the url by hand the map load just fine, however, when I use a link (either rails or a href) the map won't load until I hit refresh.</p>
  
  <p>Any ideas?</p>
  
  <p><strong><code>routes.rb</code></strong></p>
  
  <pre><code>Rails.application.routes.draw do
      root 'page#map'
  end
  </code></pre>
  
  <p><strong><code>application.html.erb</code></strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;LeafletTest&lt;/title&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /&gt;
    &lt;%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' =&gt; true %&gt;
    &lt;%= javascript_include_tag 'application', 'data-turbolinks-track' =&gt; true %&gt;
    &lt;%= csrf_meta_tags %&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;%= yield %&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong><code>map.html.erb</code></strong></p>
  
  <pre><code>&lt;%= link_to("reload page (rails)", root_path) %&gt;&lt;br /&gt;
  &lt;a href="\"&gt;reload page (a href)&lt;/a&gt;&lt;br /&gt;
  
  &lt;div id="mapid"&gt;&lt;/&gt;
  </code></pre>
  
  <p><strong><code>page.scss</code></strong></p>
  
  <pre><code>#mapid {
    width: 100%;
    height: 600px;
  }
  </code></pre>
  
  <p><strong><code>page.coffee</code></strong></p>
  
  <pre><code>$ -&gt;
    map = L.map('mapid').setView([
      51.505
      -0.09
    ], 13)
    L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', attribution: '&amp;copy; &lt;a href="http://osm.org/copyright"&gt;OpenStreetMap&lt;/a&gt; contributors').addTo map
  </code></pre>