Tipo nucleo

<%= iconbutton_new new_nucleo_type_path %>
<%= view_table_head_open %> <%= view_table_row_open %> <%= view_table_head_cell_span 2 %> <%= view_table_head_cell ('Descrizione') %> <%= view_table_head_cell ('Quanti nuclei attivi?') %> <%= view_table_head_cell ('Quante persone?') %> <%= view_table_head_cell ('Quante persone attive?') %> <%= view_table_head_cell ('Quanti Cittadini A?') %> <%= view_table_head_cell ('Quanti Cittadini A attivi?') %> <%= view_table_row_close %> <%= view_table_head_close %> <%= view_table_body_open %> <% @nucleo_types.each do |nucleo_type| %> <%= view_table_row_open %> <%= view_table_cell ( iconbutton_view nucleo_type, nil) %> <%= view_table_cell ( iconbutton_edit edit_nucleo_type_path(nucleo_type),nil) %> <%#= view_table_cell ( iconbutton_delete nucleo_type, nil) %> <%= view_table_cell (link_to(nucleo_type.descrizione, nucleo_type_path(nucleo_type))) %> <%= view_table_cell ( House.where(nucleo_type_id: nucleo_type.id).filtered_by_attivo.count ) %> <% house_ids = House.where(nucleo_type_id: nucleo_type.id).pluck(:id) %> <%= view_table_cell ( Person.where(house_id: house_ids).count ) %> <%= view_table_cell ( Person.where(house_id: house_ids).person_attiva.count ) %> <%= view_table_cell ( Person.where(house_id: house_ids).where(citizenship_id: CitizenshipsHelper::CittadinanzeA_ids).count ) %> <%= view_table_cell ( Person.where(house_id: house_ids).where(citizenship_id: CitizenshipsHelper::CittadinanzeA_ids).person_attiva.count ) %> <%= view_table_row_close %> <% end %> <%= view_table_body_close %> <%= view_table_close %>
<%= iconbutton_new new_nucleo_type_path %>