etewiah / property_web_builder

Create a fully featured real estate website on Rails in minutes! ⛺
https://propertywebbuilder.com
MIT License
545 stars 257 forks source link

Google Maps API error: RefererNotAllowedMapError #111

Closed silvanito closed 4 years ago

silvanito commented 4 years ago

Hi everybody!

I'm getting a Google Maps JavaScript API error: RefererNotAllowedMapError

So, I got a new key from Google, and added the following to my application.html.erb

<!DOCTYPE html>
<html>
  <head>
    <title>PwbForHeroku</title>
    <%= csrf_meta_tags %>

    <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track': 'reload' %>
    <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>

    <%= javascript_include_tag 'https://maps.googleapis.com/maps/api/js?key='+Rails.application.credentials.google_maps_api_key %>
    <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>

  </head>

  <body>
    <%= yield %>
  </body>
</html>

Then in the console did: rails credentials:edit And added a new line with google_maps_api_key and my key

Still no luck...

Any ideas?

etewiah commented 4 years ago

Hey Silvano, that should work. Perhaps there is a typo somewhere in setting the credentials.

Anyway, as per our phone conversation I've given you access to the pwb-premium version where I will add a section in the admin so the maps api key can be set there.