嵌套的fields_for表单不显示

时间:2012-09-24 01:04:50

标签: ruby-on-rails ruby-on-rails-3 nested-attributes

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

模特EXCERPT

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 %>

0 个答案:

没有答案