0

我正在使用未显示的嵌套 fields_for,有什么想法吗?我认为我的关系设置正确,但该字段根本没有呈现。

模型摘录

class DaysEvent < ActiveRecord::Base
belongs_to :event
belongs_to :location

accepts_nested_attributes_for :event

截断视图

<%= form_for(DaysEvent.new, :remote => true, :html => { :class => "form-inline"} ) do       |f| %>


<fieldset>
<%= f.fields_for :event do |event_form| %>   
 <div class="control-group">
  <%= event_form.label :allow_user_to_suggest_dates, :class => 'control-label' %>
  <div class="controls">
    <%= event_form.check_box :allow_user_to_suggest_dates, :class => 'text_field' %>
  </div>
</div>
</fieldset>
<% end %>
4

0 回答 0