Ruby on rails 3 rails 3多格式地理编码器

Ruby on rails 3 rails 3多格式地理编码器,ruby-on-rails-3,forms,wizard,rails-geocoder,multi-step,Ruby On Rails 3,Forms,Wizard,Rails Geocoder,Multi Step,使用来自和地理编码器的railscast 217(多步骤/向导)。我想做的是让用户在表单的第一部分输入会议地点,然后在表单的第二部分让geocoder返回geocoder过滤掉的地址列表。我该怎么做呢 我已经创建了多步骤表单。但是我应该在控制器中使用什么从表单的第一部分获取地址(街道、城市、国家),然后在表单的第二部分使用地理编码器的near属性返回附近位置的列表?解决了这个问题: 首先找到railscast中正在计费的“第二”页 elsif @order.currentplan_step ==

使用来自和地理编码器的railscast 217(多步骤/向导)。我想做的是让用户在表单的第一部分输入会议地点,然后在表单的第二部分让geocoder返回geocoder过滤掉的地址列表。我该怎么做呢

我已经创建了多步骤表单。但是我应该在控制器中使用什么从表单的第一部分获取地址(街道、城市、国家),然后在表单的第二部分使用地理编码器的near属性返回附近位置的列表?

解决了这个问题:

首先找到railscast中正在计费的“第二”页

elsif @order.currentplan_step == 'billing' (I placed this right after the first elsif)
   #now just build a location from the previous page(form) fields
   @orderlocation = params[:order][:orderaddress] + ", " + params[:order][:ordercity]

   #and create a list of addresses, now you can use @findlocations to create a list of addresses you can ship to that are near your location
   @findlocations = Location.near(@orderlocation, 20)