我试图返回一套单选按钮的基础上,在我的数据库,但我没有太多的运气。
查看代码
- @merchant_type.each do |mt|
= form.radio_button mt, mt.name控制器码
def new
@merchant_type = MerchantType.all
@merchant = Merchant.new
@states = State.form_selector
@products = Product.order(:name => 'asc')
@properties = Property.where(property_set_id: 1)
@merchant.trading_hours.build
end错误
ActionView::Template::Error (undefined method `#<MerchantType:0x007fd16b55ac50>' for #<Merchant:0x007fd16c481468>):
6: p
7: b Type
8: - @merchant_type.each do |mt|
9: = form.radio_button mt, mt.name
app/views/admin/merchants/_type.html.slim:9:in `block in _app_views_admin_merchants__type_html_slim___3402008222164699688_70268702644260'
app/views/admin/merchants/_type.html.slim:8:in `_app_views_admin_merchants__type_html_slim___3402008222164699688_70268702644260'发布于 2016-12-16 10:13:15
尝尝这个
- @merchant_type.each do |mt|
= form.radio_button :merchant_type, mt.namehttps://stackoverflow.com/questions/41181416
复制相似问题