开发者

Google-Maps-For-Rails not showing map in Rails 3.1

开发者 https://www.devze.com 2023-03-18 07:11 出处:网络
I am trying to use the gem \'gmaps4rails\'开发者_运维百科. I inserted all of the necessary code into my model and view, and I know that the geocoding is working. However, when I insert the code <%=

I am trying to use the gem 'gmaps4rails'开发者_运维百科. I inserted all of the necessary code into my model and view, and I know that the geocoding is working. However, when I insert the code <%= gmaps4rails(@json) %> into my index.html.erb file, the map does not appear.

EDIT: I downgraded the version to 0.8.8, and I was able to run rails g gmaps4rails:install to get the layouts. Does version 0.9.1 have a different command for installing the layouts?


I was having the same problem (couldn't get the generator installing) and getting the 404 for gmaps4rails.js.

The following steps worked (you had most of it).

  • I downgraded to 0.8.8;
  • ran the generator;
  • then copied the generated files from public/ to assets/;
  • changed back to version 0.9.1.

and it worked fine after that (i.e. map showing).

0

精彩评论

暂无评论...
验证码 换一张
取 消