alex
alex

Reputation: 357

to_gmaps4rails block not working?

don't understand:

in my controller:

@json = User.all.to_gmaps4rails do |user|
     "\"Title\": \"#{user.email}\""
end

in my view: <%=@json%>

result:

 [{"longitude": "2.13012", "latitude": "48.8014"}, {"longitude": "-90.556", "latitude": "41.0634"}, {"longitude": "2.35222", "latitude": "48.8566"}, {"longitude": "2.35222", "latitude": "48.8566"}, {"longitude": "2.27174", "latitude": "48.9065"}, {"longitude": "-5.97058", "latitude": "37.3815"}] 

Why the title isn't processed???

Upvotes: 0

Views: 440

Answers (1)

apneadiving
apneadiving

Reputation: 115511

I guess you're using a version prior to 0.10.0 which didn't have this option.

Simply upgrade the gem.

Upvotes: 2

Related Questions