<table class="table-address">
  <tr>
    <th>組織</th>
    <th>名前</th>
    <th>メールアドレス</th>
    <th></th>
    <th></th>
  </tr>

  <% @address_books.each do |address_book| %>
  <tr class="address_items" id="address_item_<%= address_book.id %>" data-id="<%= address_book.id %>">
    <td class="address_organization">
      <%= truncate(address_book.organization, {:length => 20}) %>
      <%= hidden_field_tag "address_book_organization_#{address_book.id}",address_book.organization, {:class => ""} %>
      <%= link_to '', address_book_path(address_book), :id => "show_address_book_#{address_book.id}", :class => 'show_address_book', :style => 'visibility:hidden;' %>
    </td>
    <td class="address_name">
      <%= truncate(address_book.name, {:length => 20}) %>
      <%= hidden_field_tag "address_book_name_#{address_book.id}",address_book.name, {:class => ""} %>
    </td>
    <td class="address_email"><%= truncate(address_book.email,  {:length => 30}) %><%= hidden_field_tag "address_book_email_#{address_book.id}",address_book.email, {:class => ""} %></td>
    <td class="address_edit"><%= link_to image_tag('common/edit.png', { :border => '0', :alt => 'edit', :title => '編集'}), edit_address_book_path(address_book) %></td>
    <td class="address_destroy" data-turbo="true">
      <%= link_to image_tag('common/trash.png', { border: '0', alt: 'destroy'}), address_book, data: { turbo_method: "delete", turbo_confirm: '削除してもよろしいでしょうか?' } %>
    </td>
  </tr>
  <% end %>

</table>

<table class="table-address-add">
  <tr>
    <td style="text-align: left;">
      <div class="pagination">
        <%= paginate @address_books, :remote => true %>
      </div>
    </td>
  </tr>
</table>
