我的模态正在工作(意味着当我点击按钮时出现)但表格没有出现,我在索引动作中有这个模态,所以我添加了<% @entries.each do |entry| %>
而没有它我是{{1} } model_name'对于NilClass:Class,有什么建议吗?
aving undefined method
time_table_entries_controller.rb
<%= link_to "Assign", "#saturday-one", :class => "btn btn-primary", "data-toggle" => "modal" %>
<div class="modal hide fade" id="saturday-one">
<div class="modal-header">
<h3 id="myModalLabel">Time Table</h3>
</div>
<div class="modal-body">
<% @entries.each do |entry| %>
<%= simple_form_for(entry) do |f| %>
<%= f.association :subject, as: :select, label: 'Select Subject' %>
<%= f.association :employee, as: :select, label: 'Assign Employee' %>
<%= f.submit %>
<% end %>
<% end %>
</div>
<div class="modal-footer">
<button aria-hidden="true" class="btn btn-info" data-dismiss="modal">Done</button>
</div>
</div>