私はRailscasts Episode#165に従っています。複数編集しても問題があります。製品インデックスページに行くと、製品リストが表示されません。私はヘッダーと新製品へのリンクだけを得ています。私が間違っていたことは何ですか?私はレール 編集複数(参考Railscasts Episode#165)
3.2.3
を使用していますところでありがとうございました。
routes.rbを
resources :products do
collection do
post :edit_multiple
put :update_multiple
end
end
resources :categories
index.html.erb
<h1>Listing products</h1>
<% form_tag edit_multiple_products_path do %>
<table>
<tr>
<th></th>
<th>Name</th>
<th>Category</th>
<th>Price</th>
</tr>
<% for product in @products %>
<tr>
<td><%= check_box_tag "product_ids[]", product.id %></td>
<td><%= product.name %></td>
<td><%= product.category.name %></td>
<td><%= product.price %></td>
<td><%= link_to "Edit", edit_product_path(product) %></td>
<td><%= link_to "Destroy", product, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
<%= submit_tag "Edit Checked" %>
<% end %>
<p><%= link_to "New Product", new_product_path %></p>
ありがとうございました。それはそれを解決しました:-) – Azren