Posted By

bordalix on 06/20/07


Tagged

checkbox checked values


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

t0d0r
stainless
millisami
webstic


checkbox with associated values checked


 / Published in: Rails
 

  1. <% Company.find(:all).each do |c| %>
  2. <input type="checkbox" name="technology[company_ids][]" value="<%= c.id %>"
  3. <% if @technology.companies.include?(c) -%> checked="checked" <% end -%> />
  4. <%= c.name %></td>
  5. <% end %>

Report this snippet  

You need to login to post a comment.