当我评论以下代码时
<script type="text/javascript">
// var data1= "<%=[@properties.map {|c| {time:c.time.strftime("%H").to_i , speed:c.speed}}].to_json%>"
//var data=JSON.parse(data1.replace(/"/g,'"'));
//alert("dataset-------------------"+data);
</script>
显示以下错误。为什么在我评论代码后会发生此错误。同时删除以下错误后的评论也会发生。
ActionView::Template::Error (undefined method `map' for nil:NilClass):
48: <div id="bar-demo" align="center">
49: <script type="text/javascript">
50:
51: // var data1= "<%=[@properties.map {|c| {time:c.time.strftime("%H").to_i , speed:c.speed}}].to_json%>"
52:
53:
54: //var data=JSON.parse(data1.replace(/"/g,'"'));
app/views/static_pages/show.html.erb:51:in `_app_views_static_pages_show_html_erb__413296487_31443192
'