<%= toggle_checkboxes_link("#custom_field_project_ids input[type=checkbox]:enabled") %><%= l(:label_project_plural) %>

<%= f.check_box :is_for_all, :data => {:disables => '#custom_field_project_ids input'} %>

<% project_ids = @custom_field.project_ids.to_a %> <%= render_project_nested_lists(Project.all) do |p| content_tag('label', check_box_tag('custom_field[project_ids][]', p.id, project_ids.include?(p.id), :id => nil) + ' ' + p.to_s) end %> <%= hidden_field_tag('custom_field[project_ids][]', '', :id => nil) %>