apneadiving / Google-Maps-for-Rails

Enables easy Google map + overlays creation in Ruby apps
https://apneadiving.github.io/
MIT License
2.26k stars 382 forks source link

Another Rails 3.1 asset pipeline approach #65

Closed raid5 closed 13 years ago

raid5 commented 13 years ago

The issue, as explained in issue apneadiving#50, is that the asset pipeline is trying to load the provider javascript files before the base gmaps4rails javascript.

I decided to

  1. rename gmaps4rails.js to gmaps4rails.base.js to account for this fact
  2. the calls to yield :head and yield :scripts now check for Rails 3.1 and the asset pipeline, outputting the correct code.
  3. the generate copies assets to the correct folder (app/assets or public) based on the Rails version.

Not completely sure this is the best approach, but it works and I'm currently using it for a Rails 3.1 project successfully.

apneadiving commented 13 years ago

I haven't used this approach towards Rails 3.1 integration.

0.11.0 is just released with the support.

Thanks anyway!

raid5 commented 13 years ago

No problem :) As long as it gets the job done! Thanks