{"action":"created","issue":{"url":"https://api.github.com/repos/amuntasim/gmap_coordinates_picker/issues/10","repository_url":"https://api.github.com/repos/amuntasim/gmap_coordinates_picker","labels_url":"https://api.github.com/repos/amuntasim/gmap_coordinates_picker/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/amuntasim/gmap_coordinates_picker/issues/10/comments","events_url":"https://api.github.com/repos/amuntasim/gmap_coordinates_picker/issues/10/events","html_url":"https://github.com/amuntasim/gmap_coordinates_picker/issues/10","id":166864849,"number":10,"title":"Works great on localhost but not on Heroku","user":{"login":"brockklein","id":2125662,"avatar_url":"https://avatars.githubusercontent.com/u/2125662?v=3","gravatar_id":"","url":"https://api.github.com/users/brockklein","html_url":"https://github.com/brockklein","followers_url":"https://api.github.com/users/brockklein/followers","following_url":"https://api.github.com/users/brockklein/following{/other_user}","gists_url":"https://api.github.com/users/brockklein/gists{/gist_id}","starred_url":"https://api.github.com/users/brockklein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brockklein/subscriptions","organizations_url":"https://api.github.com/users/brockklein/orgs","repos_url":"https://api.github.com/users/brockklein/repos","events_url":"https://api.github.com/users/brockklein/events{/privacy}","received_events_url":"https://api.github.com/users/brockklein/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-21T16:39:55Z","updated_at":"2016-07-21T18:36:59Z","closed_at":"2016-07-21T18:36:59Z","body":"Hello Ahmed I hope you are well!\r\n\r\nThanks for this handy gem - saved me some time on a quick location picker form. Needed something elegant and simple and this hit the spot perfectly, especially for a n00b like me.\r\n\r\nI'm having a problem tho. It works perfectly on **localhost**, but I just pushed to **Heroku** for testing and it fails to load.\r\n\r\nExample here: https://www.opentest.co/share/dc6c00f04f5c11e68356998afd9fab62\r\n\r\nHere's the form:\r\n\r\n```\r\n\t\t\t<div class=\"row\" style='margin-bottom: 20px;'>\r\n\t\t\t\t<% if defined? @latitude %>\r\n\t\t\t\t\t<%= form.gmap_coordinate_picker :latitude => 'latitude', :longitude => 'longitude', :default_coordinates => [@latitude, @longitude], :zoom_level => 10, :api_key => 'API KEY' %>\r\n\t\t\t\t<% else %>\r\n\t\t\t\t\t<%= form.gmap_coordinate_picker :latitude => 'latitude', :longitude => 'longitude', :zoom_level => 10, :api_key => 'API KEY' %>\r\n\t\t\t\t<% end %>\r\n\t\t\t</div>\r\n```\r\n\r\n(I know, it's bad form to pass the API key in the open - just doing this for testing before going back through and moving everything into `environments` and `secrets.yml`.)\r\n\r\nI didn't do much with `gmap_coordinates_picker_config.rb` but here it is for reference:\r\n\r\n```\r\nGmapCoordinatesPicker.configure do |config|\r\n  #config.lat_column = :latitude\r\n  #config.lng_column = :longitude\r\n  config.default_coordinates = [39.8282, -98.5795] #Dhaka (my home town) center point :)\r\n  #config.map_handler = 'gMapObj' #javascript map object\r\n  #config.zoom_level = 10\r\n  #config.map_container_class = 'gmap_coordinate_picker_container'\r\n  #config.map_width = '600px'\r\n  #config.map_height = '400px'\r\nend\r\n```\r\n\r\nAny suggestions on what I might be doing wrong? I'm guessing it has to do with the Google Maps API Key, but both Javascript and Places are enabled, so I'm not sure what the problem would be. I am using the key named **Browser key (auto created by Google Service)**.\r\n\r\nThe page is being served over HTTPS (if that matters).\r\n\r\nAny help you can offer would be greatly appreciated! \r\n\r\nBrock\r\n\r\n(Also, not that it matters, but below is my `Gemfile` for proof I didn't accidentally put the gem in the development group.)\r\n\r\n```\r\nsource 'https://rubygems.org'\r\n\r\n\r\n# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'\r\ngem 'rails', '4.2.5'\r\n# Use sqlite3 as the database for Active Record\r\ngem 'pg'\r\n# Use SCSS for stylesheets\r\ngem 'sass-rails', '~> 5.0'\r\n# Use Uglifier as compressor for JavaScript assets\r\ngem 'uglifier', '>= 1.3.0'\r\n# Use CoffeeScript for .coffee assets and views\r\ngem 'coffee-rails', '~> 4.1.0'\r\n# See https://github.com/rails/execjs#readme for more supported runtimes\r\n# gem 'therubyracer', platforms: :ruby\r\n\r\n# Use jquery as the JavaScript library\r\ngem 'jquery-rails'\r\n# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks\r\ngem 'turbolinks'\r\n# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder\r\ngem 'jbuilder', '~> 2.0'\r\n# bundle exec rake doc:rails generates the API under doc/api.\r\ngem 'sdoc', '~> 0.4.0', group: :doc\r\n\r\n# gem 'mysql2', '0.4.2'\r\n\r\ngem 'will_paginate', '3.0.3'\r\n\r\ngem 'jquery-turbolinks'\r\n\r\ngem 'mini_magick'\r\n\r\ngem 'carrierwave'\r\n\r\ngem 'fog'\r\n\r\ngem 'active_model_serializers'\r\n\r\ngem 'materialize-sass'\r\n\r\ngem 'jquery-timepicker-rails'\r\n\r\ngem 'time_splitter'\r\n\r\ngem 'migration_data'\r\n\r\ngem 'devise'\r\n\r\ngem 'figaro'\r\n\r\ngem 'devise_invitable'\r\n\r\ngem 'gmap_coordinates_picker'\r\n\r\n# Use ActiveModel has_secure_password\r\n# gem 'bcrypt', '~> 3.1.7'\r\n\r\n# Use Unicorn as the app server\r\n# gem 'unicorn'\r\n\r\n# Use Capistrano for deployment\r\n# gem 'capistrano-rails', group: :development\r\n\r\ngroup :development, :test do\r\n  # Call 'byebug' anywhere in the code to stop execution and get a debugger console\r\n  gem 'byebug'\r\nend\r\n\r\ngroup :development do\r\n  # Access an IRB console on exception pages or by using <%= console %> in views\r\n  gem 'web-console', '~> 2.0'\r\n\r\n  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring\r\n  gem 'spring'\r\nend\r\n\r\ngem 'rails_12factor', group: :production\r\n\r\nruby \"2.2.3\"\r\n```\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/amuntasim/gmap_coordinates_picker/issues/comments/234344101","html_url":"https://github.com/amuntasim/gmap_coordinates_picker/issues/10#issuecomment-234344101","issue_url":"https://api.github.com/repos/amuntasim/gmap_coordinates_picker/issues/10","id":234344101,"user":{"login":"brockklein","id":2125662,"avatar_url":"https://avatars.githubusercontent.com/u/2125662?v=3","gravatar_id":"","url":"https://api.github.com/users/brockklein","html_url":"https://github.com/brockklein","followers_url":"https://api.github.com/users/brockklein/followers","following_url":"https://api.github.com/users/brockklein/following{/other_user}","gists_url":"https://api.github.com/users/brockklein/gists{/gist_id}","starred_url":"https://api.github.com/users/brockklein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brockklein/subscriptions","organizations_url":"https://api.github.com/users/brockklein/orgs","repos_url":"https://api.github.com/users/brockklein/repos","events_url":"https://api.github.com/users/brockklein/events{/privacy}","received_events_url":"https://api.github.com/users/brockklein/received_events","type":"User","site_admin":false},"created_at":"2016-07-21T18:36:59Z","updated_at":"2016-07-21T18:36:59Z","body":"Ahmed, thank you VERY much for such a quick reply.\r\n\r\nOf course...rookie mistake on my part - I had not checked the console for JS errors. It turns out it actually is related to using HTTPS since [the gem includes](https://github.com/amuntasim/gmap_coordinates_picker/search?utf8=%E2%9C%93&q=googleapis) `http://maps.googleapis.com/maps/api/...`.\r\n\r\n<img width=\"1266\" alt=\"screen shot 2016-07-21 at 1 46 35 pm\" src=\"https://cloud.githubusercontent.com/assets/2125662/17032921/9ac75a72-4f49-11e6-9901-4c8eca5938a1.png\">\r\n\r\nI had no idea how to intercept and replace that include tag with the `https` version so I forked the gem so I can add the `s` and source it from my forked version. =) \r\n\r\n`gem 'gmap_coordinates_picker', :git => 'git://github.com/brockklein/gmap_coordinates_picker'`\r\n\r\nTo be sure, I also disabled turbolinks with the method described here: http://stackoverflow.com/a/27482171/1594335\r\n\r\nThat seemed to do the trick!\r\n\r\nWhen I have a moment I'll edit the files and your instructions with some suggested edits so folks can include the JS in their own Asset Pipeline instead of in the partial."}}
{"actor":{"display_login":"brockklein"}}