标签: ruby-on-rails geokit
我想在Rails中计算与Geokit的距离,并使用within子句。但是当我在我的子句中添加列名时,我有以下错误:
within
NoMethodError:未定义方法`to_f':distance:Symbol
mobility_request = Mobility.within(:distance, :origin =>[self.location.latitude,self.location.longitude]).includes(:location)
如何使用:距离符号而不出错?