我在show.erb中嵌套了属性,并创建了一个空白的嵌套属性,并显示了底部空白的项目网格,如此.
<%= form_for @question do |q| %> <% q.fields_for :answers,@question.answers do |l| %> <tr> <td><%= l.text_field :text %></td> <td><%= l.check_Box :correct %></td> <td><%= l.text_field :imagename %></td> <td><%= l.number_field :x %></td> <td><%= l.number_field :y %></td> </tr> <% end %> <tr> <td colspan=5 align=right><%= submit_tag '+' %> </tr> <% end %>
我想要一个link_to’Destroy’工作,但当我将其添加到网格时,我得到未定义的方法’复数’
<%= link_to 'Destroy',l,:controller => "answer",:confirm => 'Are you sure?',:method => :delete %>