【发布时间】:2013-06-15 20:51:06
【问题描述】:
我正在构建一个插件来狂欢,我需要在我的应用程序中。我们使用的运输公司不向私人地址运送,而是向全国各地的一些包裹店运送。因此,当用户在结账时到达送货步骤时,他/她是否必须在他/她可以取货的多个地点中进行选择。
我的问题是我想让用户使用单选按钮在这些地点/地址中进行选择。那么如何(或者可能?)发布所选包裹商店的所有属性(街道名称、城市、邮政编码等)并将其存储为订单的送货地址?我现在拥有的是这样的:
<%= form_for @order do |f| %>
<% @parcel_shops.each do |parcel_shop| %>
<%= f.fields_for :ship_address, parcel_shop do |ship_form| %>
# This is the part that i need to change
<%= ship_form.radio_button :attributes, parcel_shop.attributes
<% end %>
<% end %>
...
<% end %>
任何帮助将不胜感激,在此先感谢:)!
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 forms radio-button spree