gmaps4rails回调没有解雇

= gmaps(markers: { data: @json, options: @marker_options }, map_options: @map_options ) - content_for :map_scripts do :javascript Gmaps.map.callback = function() { alert('asdf') // <-- I never see this alert } 

使用gmaps4rails gem(v1.5.2),我将上面的代码放在我的视图中。 我的地图看起来很好用我的标记。 但是用我的javascript,我不应该得到警报(我不是)? 我不确定我是否完全理解回调。

仅供参考,javascript在我的源代码中显得很好。

它应该是content_for :scripts文档中提到的content_for :scripts

另外,根据您的浏览器,您最好: alert('asdf'); 而不是alert('asdf')