<% @data.each do |d| %>
  <% if d.parent_id.to_i > 0 %>
     <tr class="node job_classifies-item-<%= d.id %>" data-tt-id="<%= d.id %>" data-name="<%= d.name%>" data-position="<%= d.position %>" data-tt-parent-id="<%= d.parent_id %>" data-parent-id=<%= d.parent_id%>  data-tt-branch="<%= d.parent_id == 0 ? "true" : "false" %>">
  <% else %>
    <tr class="root-node job_classifies-item-<%= d.id %>" data-tt-id="<%= d.id %>"  data-name="<%= d.name%>" data-position="<%= d.position %>" data-parent-id=<%= d.id%>  data-tt-branch="<%= d.parent_id == 0 ? "true" : "false" %>">
  <% end %>
    <td class="text-left"><span class="job-name <%= d.parent_id.to_i == 0 ? 'directory' : 'file'%>"><%= d.name %></span></td>
    <td><%= d.position %></td>
    <td> 
      <span class="mr-4"><%= link_to '编辑', edit_admins_job_classify_path(d), remote: true, class: 'action' %></span>
      <%= delete_link '删除', admins_job_classify_path(d, element: ".job_classifies-item-#{d.id}")%>
    </td>
  </tr>
<% end %>