Guest User

Untitled

a guest
Jan 21st, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.25 KB | None | 0 0
  1. <table class="table_dash">
  2.     <!-- questo é comune a tutti e lo metti fuori dal ciclo-->
  3.     <thead>
  4.         <tr>
  5.                     <th scope="col"> Sommario Schede </th>
  6.                 </tr>    
  7.                 <tr>
  8.                     <th scope="col">Titolo</th>
  9.                     <th scope="col">Sottotitolo</th>
  10.                     <th scope="col">Autore</th>
  11.                     <th scope="col">Data</th>
  12.                 </tr>
  13.         </thead>
  14.         <tbody>
  15.     <!-- questo lo devi mettere qui e far correre il ciclo sui tr del tbody-->
  16.     <% @lezione.selezioni.each do |selezione| %>  
  17.     <tr>
  18.            <td>  
  19.         <%= link_to selezione.scheda.titolo, [@lezione,selezione] %>
  20.         <%- if can? :manage, @lezione -%>
  21.                 <span style="float: right;">
  22.                    <%= link_to "Su", up_lezione_selezione_path(@lezione,selezione), :method => :post %>
  23.                    <%= link_to "Giu", down_lezione_selezione_path(@lezione,selezione), :method => :post %>
  24.                    <%= link_to "Rimuovi", [@lezione,selezione], :method => :delete %>
  25.                 </span>
  26.                 <% end %> <!-- questo chiude l'if DENTRO il td e il tr-->
  27.              </td>
  28.           </tr>
  29.           <%- end -%> <!--chiude il ciclo sulle lezioni-->
  30.       </tbody>
  31.     </table>
Add Comment
Please, Sign In to add comment