title: undefined method `map' for nil:NilClass in ruby on rails
body: <p>when i comment the following code </p>
  
  <pre><code>   &lt;script type="text/javascript"&gt;
  
       // var data1= "&lt;%=[@properties.map {|c| {time:c.time.strftime("%H").to_i , speed:c.speed}}].to_json%&gt;"
  
  
      //var data=JSON.parse(data1.replace(/&amp;quot;/g,'"'));
  
      //alert("dataset-------------------"+data);
  &lt;/script&gt;
  </code></pre>
  
  <p>Following error is showing.Why this error occur after i commented the code.While removing comments following error also occurring.</p>
  
  <pre><code> ActionView::Template::Error (undefined method `map' for nil:NilClass):
          48: &lt;div id="bar-demo" align="center"&gt;
          49: &lt;script type="text/javascript"&gt;
          50: 
          51:  // var data1= "&lt;%=[@properties.map {|c| {time:c.time.strftime("%H").to_i , speed:c.speed}}].to_json%&gt;"
          52: 
          53: 
          54: //var data=JSON.parse(data1.replace(/&amp;quot;/g,'"'));
        app/views/static_pages/show.html.erb:51:in `_app_views_static_pages_show_html_erb__413296487_31443192
  </code></pre>
  
  <p>'</p>