0

I am trying to use gmaps4rails gem to implement google map to create polygon. I am using Rails 4 with Mongodb (Mongoid). Where I am using geospatial queries to get my results and later I will be showing a set of cordinates as polygon on gmap. I installed and set up gmaps4rails gem with all instruction given as per its github page. But my app had no javascript folder in its assets pipeline as it was created by command "Rails new -OJ". so it skipped all javascript folders and jquery installation. But I added it manually to bothe vendor and assets folder.
Later I faced the problem with can not find gmap/ .map / underscore.js etc. after trying every solution in web the error was resolved. Then even though there were no error on chrome consol(inspect element) the map was not showing up.

I realised that it must be happenning because of -OJ command. Then I tried with "Rails new -OT" command and repeated all the gmaps4rails setup. Then it just worked fine.

I still dont know why did i use -OJ insteat of -OT at the first place. but now damage is done. and I have my major project ready with long database but it doesnt work with maps (because of -OJ thing).

So the main issue is; just because there were no Javascripts folder present in the app at the first place, the gmaps4rails doesnt work for me.

Can someone please tell me even after adding all the javascript folders manually, what cud be the problem, why the gmap4rails does not work when we add javascripts dir manually. How can i generate the asset pipeline again ?

If i could do so, that would save me lot of time to recreate the whole project.

punkb
  • 53
  • 12
  • a very quick solution: use js from a cdn: http://fr.cdnjs.com/libraries/gmaps4rails – apneadiving Nov 03 '14 at 07:30
  • thanks @apneadiving I tried this, but it wasnt working for me. Then I had to creat a new project with only skipping Active records (Rails new app -O). gmaps4rails rocks though. Made my work a lot easier. – punkb Nov 17 '14 at 00:14

0 Answers0