<%= stylesheet_link_tag "admin" %>

<%= render :partial => "submenu" %>

<div id="main"><!-- メイン -->
<h2>特集管理</h2>
<div class="btn_t">
<% form_tag "/admin/feature_products/new" do -%>
  <%= hidden_field_tag "feature_id", params[:feature_id] %>
  <%= submit_tag '新規登録',:class =>"btn_s" %>
<% end %>
</div>
<br/>
<h3>商品一覧</h3>
<%= flash[:notice] %>
<%= flash[:error] %>
<table class="data2" cellspacing="1">
  <tr>
    <th>ID</th>
	<th>商品名</th>
    <th>画像</th>
    <th>コメント</th>
    <th>編集</th>
    <th>削除</th>
  </tr>
  <% unless @feature_products.empty? -%>
    <% @feature_products.each_with_index do | record, index | -%>
    <% @record = record -%>
  <tr>
    <td><%=h record.id %></td>
	<td><%=h record.product.name %></td>
	<td><%= view_resource_id record.image_resource_id, {:width=>"100px"} %></td>
	<td><%=h record.body %></td>
    <td class="t_center"><%= link_to "編集", edit_admin_feature_product_path(record)%></td>
    <td class="t_center"><%= link_to "削除", { :action => "destroy", :id => record.id}, :confirm => "本当に削除しますか？", :method => "delete" %></td>
  </tr>
    <% end -%>
  <% end -%>
</table>
</div><!-- メイン -->
