我有这段代码可以在页面上显示多个地图:
.row
.span12
- counter = 1
- @users.each do |user|
- map_visits = user.visits.to_gmaps4rails
- unless map_visits.blank?
.span3
%div{ id: "container_#{counter}" }
%div{ id: "map_#{counter}" }
= gmaps(map_options: { zoom: 6, container_id: "container_#{counter}", id: "map_#{counter}" }, markers: { data: map_visits } )
- counter += counter
它返回一个错误“语法错误,意外的keyword_ensure,期待$end”,但我真的不知道这里出了什么问题。Better_errors gem 显示代码中 3 个“container_#{counter}”项的错误。有任何想法吗?