Monday, 19 August 2013

Use gmaps4rails from json

Use gmaps4rails from json

I am working on small project and need use google map. I decide to use gem
'gmaps4rails' to easier map implementation. The problem is all
documentation showing how to get json object from model and DB and I have
to use json as data:
{"listings":[
{ "id":1001, "name":"home1", "description":"home 1 description!",
"street":"45 Broadway", "city":"New
York","state":"NY","zipcode":"11011","country":"US"},
{ "id":1002, "name":"home2", "description":"home 2 description!",
"street":"45 Madison Ave", "city":"New
York","state":"NY","zipcode":"11006","country":"US"} ]}
I want to get the map attributes only from it and pass it through
controller and display it to the view, I pretty new on using json so if
somebody can guide me through this problem I will really appreciated.

No comments:

Post a Comment