通过https / SSL使用gmaps4rails [英] Using gmaps4rails with https/SSL

查看:124
本文介绍了通过https / SSL使用gmaps4rails的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是gmaps4rails的忠实粉丝 - 它让我们的网络应用非常容易添加地图。我现在遇到的唯一问题是,如果您在https页面上使用它,则会收到有关混合内容的安全警告。 google maps api确实支持https,所以我认为这只是一个将脚本引用从http更改为https的问题。不幸的是,我认为它隐藏在acts_as_gmappable语句后面 - 我希望能修改content_for块。

I'm a big fan of gmaps4rails - it's made adding maps to our web app very easy. The only problem I'm hitting now is that if you use it on an https page, then you get security warnings about mixed content. The google maps api does support https, so I think it's just a question of changing the script references from http to https. Unfortunately I think it's hidden behind the "acts_as_gmappable" statement - I was hoping for a content_for block I could modify.

有没有简单的方法可以使用https版本的API?

Is there an easy way to make it use the https version of the API?

http://code.google.com/apis/maps/documentation/javascript/basics.html#HTTPS

非常感谢,

Alex

Alex

推荐答案

这不是一个非常明显的标题, 在宝石wiki的杂项部分。

It's not a very obvious title but your solution lies in the Miscellaneous section of the gem's wiki.

只需看一看:

Just have a look:

<%= gmaps( data_hash, enable_css, enable_js) %>

enable_css enable_js 是布尔值。

所以,如果你这样做:

So if you do:

<%= gmaps( data_hash, true, false) %>

它不会加载任何js。他的方式可以添加你想要的任何东西。不要忘记包含 gmaps4rails.js 文件!

It won't load any js. his way you can add whatever you want by yourself. Don't forget to include the gmaps4rails.js file!

这篇关于通过https / SSL使用gmaps4rails的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆