Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 轨道可以';t显示谷歌地图嵌入API_Ruby On Rails_Google Maps_Ruby On Rails 4_Google Maps Api 3 - Fatal编程技术网

Ruby on rails 轨道可以';t显示谷歌地图嵌入API

Ruby on rails 轨道可以';t显示谷歌地图嵌入API,ruby-on-rails,google-maps,ruby-on-rails-4,google-maps-api-3,Ruby On Rails,Google Maps,Ruby On Rails 4,Google Maps Api 3,在我的rails应用程序中,我尝试使用GoogleMaps嵌入式API 当我使用以下各项时,一切正常: <iframe width="500" height="300" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?key=AIzaSyDBvzq5WsidARhAZ0821MB1iAMTPnHiamI&q=3177 shawnee ct,camer

在我的rails应用程序中,我尝试使用GoogleMaps嵌入式API

当我使用以下各项时,一切正常:

    <iframe width="500" height="300" frameborder="0" style="border:0"
      src="https://www.google.com/maps/embed/v1/place?key=AIzaSyDBvzq5WsidARhAZ0821MB1iAMTPnHiamI&q=3177 shawnee ct,cameron park,ca,95682" allowfullscreen>
    </iframe>
但它无法识别我的rails对象
@job.jobsite.full\u address
。我已经知道有一个地址存储在那里,我用静态映射API测试了它,一切正常

但是,当我尝试渲染贴图时,会出现以下错误:

Google Maps API服务器拒绝了您的请求。无效的请求。 无效的“q”参数


谁能告诉我为什么
@job.jobsite.full_address
在我提供的url中不起作用

请用ruby标记替换您的位置

<iframe width="500" height="300" frameborder="0" style="border:0"
  src="https://www.google.com/maps/embed/v1/place?key=AIzaSyDBvzq5WsidARhAZ0821MB1iAMTPnHiamI&q=<%=@job.jobsite.full_address%>" allowfullscreen>

请用ruby标记替换您的位置

<iframe width="500" height="300" frameborder="0" style="border:0"
  src="https://www.google.com/maps/embed/v1/place?key=AIzaSyDBvzq5WsidARhAZ0821MB1iAMTPnHiamI&q=<%=@job.jobsite.full_address%>" allowfullscreen>