Return to Snippet

Revision: 3220
at June 20, 2007 03:02 by bordalix


Initial Code
<p>Companies:<br/>
<table class="tbl">
  <% cells = 0 %>
  <% Company.find(:all).each do |c| %>
    <% cells += 1 %>
    <% if cells.divmod(3)[1] == 1 -%><tr><% end -%>  
    <td><input type="checkbox" name="technology[company_ids][]" value="<%= c.id -%>" 
    <% if @technology.companies.include?(c) -%> checked="checked" <% end -%> />
    <%= c.name %></td>
    <% if cells.divmod(3)[1] == 0 -%></tr><% end -%>
  <% end %>
</table>
</p>

Initial URL

                                

Initial Description

                                

Initial Title
checkbox with associated values checked in a 3 columns table

Initial Tags
table

Initial Language
Rails