Image_tag到iframe

时间:2015-08-06 01:33:46

标签: ruby-on-rails image iframe

我在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?

1 个答案:

答案 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>