title: updating javascript_include_tag dynamically on show.html.erb
body: <p>So here is the scenario:</p>
  
  <p>I have 4 entries in a database, they are 4 map routes.</p>
  
  <p>Each map route has its own XML file containing the co-ordinates of each route, I have written an ajax function to pull the data from the xml and write it to a google map</p>
  
  <p>this is an extract from the code</p>
  
  <pre><code>$.ajax({                  
   type: 'GET',
   url: '/route4.gpx',            
   dataType: 'xml',             
   success: function(track) {
     var grids = [];         
     var bounds = new google.maps.LatLngBounds ();  
     $(track).find('trkpt').each(function() {       
       var lat = $(this).attr('lat');            
       var lon = $(this).attr('lon');
       var point = new google.maps.LatLng(lat, lon);    
       grids.push(point);                              
       bounds.extend(point);
  </code></pre>
  
  <p>I have this code saved into 4 javascript files where the URL line is different on each (route1.gpx, route2.gpx etc)</p>
  
  <p>What I want to do is on the show.html.erb file is to change the javascript_include_tag to update to the relevant javascript file</p>
  
  <p>So the show.html.erb tags look like the following</p>
  
  <pre><code>&lt;%= javascript_include_tag  "http://maps.google.com/maps/api/js?sensor=false" ,"http://code.jquery.com/jquery-1.9.1.min.js", "/js/script1.js" =%&gt;
  </code></pre>
  
  <p>what I would like is the last reference to change when I visit a different page so</p>
  
  <p>when linked to show/1  the javascript file would be "/js/script1.js"</p>
  
  <p>when linked to show/2  the javascript file would be "/js/script2.js"</p>
  
  <p>when linked to show/3  the javascript file would be "/js/script3.js"</p>
  
  <p>when linked to show/4  the javascript file would be "/js/script4.js"</p>
  
  <p>So is there anyway to write into the javascript_include_tag to achieve this?</p>
  
  <p>All help/suggestions/comments appreciated</p>