<tr>
  <td class="content_table_title" colspan="2">メッセージ送信</td>
</tr>
<tr>
  <th>[宛先]</th>
  <td>
    <% @receivers.each do |r| %>
      <%= h r.name %><br />
    <% end %>
    <% params[:receiver_ids].each do |id| %>
      <%= hidden_field_tag "receiver_ids[]", id %>
    <% end %>
  </td>
</tr>
<tr>
  <th>[件名]</th>
  <td><%= h @message.subject %></td>
  <%= f.hidden_field :subject %>
</tr>
<tr>
  <th>[本文]</th>
  <td><%= hbr @message.body %></td>
  <%= f.hidden_field :body %>
</tr>
<tr>
  <% @message.sorted_attachments.each_with_index do |attachment, i| %>
    <% fields_for "message[attachments_attributes][#{i+1}]", attachment do
         |f_ba|  %>
    <tr>
      <th>[添付ファイル<%=h attachment.position %>]</th>
      <td class="data">
        <%= confirm_message_attachment_image(f_ba, attachment) %>
        <%= f_ba.hidden_field :image_temp %>
        <%= f_ba.hidden_field :position %>
        <%= f_ba.hidden_field :id unless attachment.new_record? %>
      </td>
    </tr>
  <% end %>
<% end %>

<%= hidden_field_tag("id", @group.id) %>
<%= hidden_field_tag("message_notice", 1) %>
