我的gmap上只有一个标记:
<%= gmaps({
"map_options" => { "auto_zoom" => false, "zoom" => 3, "auto_adjust" => false},
"markers" => { "data" => @json }
}) %>
<% content_for :scripts do %>
<script type="text/javascript" charset="utf-8">
var marker = null;
Gmaps.map.callback = function()
{
google.maps.event.addListener(Gmaps.map.map, "click",
function(object)
{
if (marker != null) { marker.setMap(null); }
marker = new google.maps.Marker({position: object.latLng, map: Gmaps.map.map});
});
};
</script>
<% end %>
如何将标记保存到数据库?我的控制器应该怎么样?谢谢!