checkbox with associated values checked


/ Published in: Rails
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.