3
我有以下代碼,並希望它,以便您可以單擊「刪除」它將檢查複選框。有沒有簡單的解決方案呢?我無法弄清楚如何用link_to做到這一點。link_to檢查複選框
<%= f.fields_for :photos do |photo_fields| %>
<% unless photo_fields.object.new_record? %>
<%= link_to image_tag(photo_fields.object.photo.url(:user_thumbnail)), photo_fields.object.photo.url(:original), class: "fancybox"%>
<%= photo_fields.check_box :_destroy %> <span> delete </span>
<% end %>
<% end %>
哇感謝簡單,不知道該標籤的標籤;我是一名新程序員,歡呼。 – APJ 2013-04-04 06:23:44
只需要注意這裏標籤會導致換行,所以請按照以下步驟操作: – Jaqx 2013-04-04 06:43:37