我在image_tag中有这个代码
<%= image_tag "http://maps.google.com/maps/api/staticmap?size=450x300&sensor=false&zoom=16&markers=#{@presale.latitude}%2C#{@presale.longitude}", width: "300", height:"200" %>
我用geocoder gem
如何将其放入iframe?
答案 0 :(得分:0)
HAML
%iframe{src: "http://maps.google.com/maps/api/staticmap?size=450x300&sensor=false&zoom=16&markers=#{@presale.latitude}%2C#{@presale.longitude}", style: {width: "300", height:"200"} }
和html
<iframe src="http://maps.google.com/maps/api/staticmap?size=450x300&sensor=false&zoom=16&markers=#{@presale.latitude}%2C#{@presale.longitude}" style="width:300px; height: 200px;">/iframe>