2011-04-14 45 views
0

一个simplegeo API调用与simplegeo认证后一个例子,我只是试图执行此:寻找使用Ruby

SimpleGeo::Client.get_context(37.772445,-122.405913) 

结果转换为@variable并显示@variable对我的“视图”页面。

有什么建议吗?谢谢!

+0

当您尝试这样做时会发生什么? – 2011-04-14 15:54:54

+0

它转储原始响应到网页。不幸的是,它不解析JSON数据,所以我试图清理它。 – soymedia 2011-04-14 15:57:27

+0

究竟是什么问题了吗? 'simplegeo'的响应不会被'JSON.parse'解析? – 2011-04-14 18:37:16

回答

1

我工作的宝石,现在叫SimpleGeo-Rails的。它应该使SimpleGeo Places的整个过程更像轨道一样。只需添加以下到您的Gemfile,然后checkout the readme

gem 'simplegeo-rails', :git => 'https://github.com/mgadda/simplegeo-rails.git'