Gmaps4rails allows you to update your map on the fly.
Check here the valid json format you should provide: https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Control-what-I-display
If you want to replace the current markers with your new ones:
Gmaps4Rails.replace_markers(your_markers_json_string); //this is a JS function
If you want to add markers to those already displayed (it doesn't check duplicates):
Gmaps4Rails.add_markers(your_markers_json_string); //this is a JS function
Notice that you can use all javascript functions written in gmaps4rails.js directly. I hope the file has enough comments to make everything clear.
gmaps4rails.js
You can generate javascript to update your map the same way it's used to create it. Simply use the to_gmaps4rails method after your hash as described here: https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Methods
to_gmaps4rails
There was an error while loading. Please reload this page.