Closed alexbrand closed 11 years ago
Your model is geocoded on save, simply.
On Oct 30, 2012, at 8:56 PM, alexbrand notifications@github.com wrote:
I followed the tutorial and I am getting a map on my view.
However, the map is not showing my models.
I looked into the @json variable in my view, and it is empty
I am not sure what could be wrong.
Here is my model method:
def gmaps4rails_address
"#{self.address}, #{self.urbanization}, #{self.city.name}"
"619 Johnson Street, Kingston, ON"
end Here is my controller code:
def map @businesses = Business.all @json = @businesses.to_gmaps4rails
respond_to do |format| format.html format.json {render json:@businesses} end end View code: (slim)
=gmaps4rails(@json) =@json @json = []
— Reply to this email directly or view it on GitHub.
I followed the tutorial and I am getting a map on my view.
However, the map is not showing my models.
I looked into the @json variable in my view, and it is empty
I am not sure what could be wrong.
Here is my model method:
Here is my controller code:
View code: (slim)
@json =
[]