开发者

gmaps4rails not showing in production

开发者 https://www.devze.com 2023-03-29 18:53 出处:网络
All is in the title I\'ve tried: config.serve_static_assets = true I updated the gem and then: rails generate gmaps4rails:install

All is in the title

I've tried:

  • config.serve_static_assets = true

  • I updated the gem and then: rails generate gmaps4rails:install

The map is perfectly showing in local mode but doesnt appear un production! the is totaly empty... Here is the content of my head:

  <head>
  <link href="/images/favicon.ico" rel="SHORTCUT ICON">
  <link type="text/css" rel="stylesheet" media="screen" href="/stylesheets/gmaps4rails.css?1314057878">
 <link type="text/css" rel="stylesheet" media="screen" href="/stylesheets/reset.css?1314057878">
 <link type="text/css" rel="stylesheet" media="screen" hre开发者_开发技巧f="/stylesheets/default.css?1314057878">
 <link type="text/css" rel="stylesheet" media="screen" href="/stylesheets/buttons.css?1314057878">
 <link type="text/css" rel="stylesheet" media="screen" href="/stylesheets/colorbox.css?1314057878">
 <script type="text/javascript" async="" src="http://www.google-analytics.com/ga.js"></script>
 <script type="text/javascript" src="/javascripts/application.js?1314057878"></script>
 <script type="text/javascript" src="/javascripts/jquery.1.4.4.js?1314057878"></script>
 <script type="text/javascript" src="/javascripts/jquery-ui.js?1314057878"></script>
 <script type="text/javascript" src="/javascripts/jquery.colorbox-min.js?1314057878"></script>
 <script type="text/javascript" src="/javascripts/jquery-ujs-1.4.4.js?1314057878"></script>
 <script type="text/javascript" src="/javascripts/application.js?1314057878"></script>
 <script type="text/javascript" src="/javascripts/active_scaffold/default/active_scaffold.js?1314057900"></script>
 <script type="text/javascript" src="/javascripts/active_scaffold/default/jquery.editinplace.js?1314057900"></script>
 <script type="text/javascript" src="/javascripts/active_scaffold/default/date_picker_bridge.js?1314057900"></script>
 <link type="text/css" rel="stylesheet" media="screen" href="/stylesheets/active_scaffold/default/stylesheet.css?1314057900">
 <!--[if IE]><link href="/stylesheets/active_scaffold/default/stylesheet-ie.css?1314057900" media="screen" rel="stylesheet" type="text/css" /><![endif]--> 
 <meta content="authenticity_token" name="csrf-param">
 <meta content="/MYbif2q6UmcrXyAS7WyYtOViwkr8pyXjXQTTNYtQsc=" name="csrf-token">
 <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&amp;libraries=places"></script>
 <script type="text/javascript" src="http://maps.gstatic.com/cat_js/intl/fr_ALL/mapfiles/api-3/6/0a/%7Bmain,places%7D.js"></script>
 <script type="text/javascript" charset="UTF-8" src="http://maps.gstatic.com/cat_js/intl/fr_ALL/mapfiles/api-3/6/0a/%7Bcommon,util%7D.js"></script></head>

Any idea?


I had the same problem with the pre 1.x, although it was fixed by calling each file individually in the manifest file after manually loading them into the vendor asset dir.

However, the latest gem worked as it said in the readme. From an older version update it via bundler, remove any of it's js files copied into the assets dir (like I had previously), run the install script again, and in the manifest file (I'm using vendor/assets/javascript/external.js) use the namespaced require statement for the files you need.

//= require gmaps4rails/googlemaps.js 
0

精彩评论

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