进出口使用simple_form宝石,我需要做的嵌套形式,但这里有麻烦IM是一些代码:轨嵌套的模型形式HAS_ONE协会
我有两个型号:
Apiphones:
class Apiphone < ActiveRecord::Base
attr_accessible :key, :phone
validates_presence_of :phone
belongs_to :store
end
商店:
class Store < ActiveRecord::Base
has_one :apiphone
accepts_nested_attributes_for :apiphone
end
在我看来:
<%= simple_form_for [@group,@store] do |f| %>
<%= f.simple_fields_for :apiphone do |ph| %>
<%= ph.input :phone %>
<% end %>
<% end %>
但没有任何显示,任何想法?
谢谢!这固定它,你的男人:) –
非常感谢!困惑了很久 –