diff --git a/app/views/trackers/_form.html.erb b/app/views/trackers/_form.html.erb index 107095540..7b5b7ea61 100644 --- a/app/views/trackers/_form.html.erb +++ b/app/views/trackers/_form.html.erb @@ -46,8 +46,9 @@
<% if @projects.any? %>
<%= l(:label_project_plural) %> +<% project_ids = @tracker.project_ids.to_a %> <%= render_project_nested_lists(@projects) do |p| - content_tag('label', check_box_tag('tracker[project_ids][]', p.id, @tracker.projects.to_a.include?(p), :id => nil) + ' ' + h(p)) + content_tag('label', check_box_tag('tracker[project_ids][]', p.id, project_ids.include?(p.id), :id => nil) + ' ' + h(p)) end %> <%= hidden_field_tag('tracker[project_ids][]', '', :id => nil) %>

<%= check_all_links 'tracker_project_ids' %>