/ Published in: Rails
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<p>Contact:<br/> <table class="tbl"> <% cells = 0 %> <% Contact.find(:all).each do |c| %> <% cells += 1 %> <% if cells.divmod(3)[1] == 1 -%><tr><% end -%> <td><input type="radio" name="task[contact_id]" value="<%= c.id -%>" <% if @task.contact == c -%> checked="checked" <% end -%> /> <%= c.name %></td> <% if cells.divmod(3)[1] == 0 -%></tr><% end -%> <% end %> </table> </p>