diff --git a/app/controllers/cards/assignments_controller.rb b/app/controllers/cards/assignments_controller.rb index 9516ebc2f..80b6c8149 100644 --- a/app/controllers/cards/assignments_controller.rb +++ b/app/controllers/cards/assignments_controller.rb @@ -2,6 +2,8 @@ class Cards::AssignmentsController < ApplicationController include CardScoped def new + @users = @collection.users.active.alphabetically + fresh_when @users end def create diff --git a/app/views/cards/assignments/new.html.erb b/app/views/cards/assignments/new.html.erb index ee7f8a74c..8642e2c0a 100644 --- a/app/views/cards/assignments/new.html.erb +++ b/app/views/cards/assignments/new.html.erb @@ -7,13 +7,13 @@ navigable_list_actionable_items_value: true } do %> Assign this to… - <% if @collection.users.active.count > 1 %> + <% if @users.many? %> <%= text_field_tag :search, nil, placeholder: "Filter…", class: "input input--transparent txt-small margin-block-half", autofocus: true, type: "search", autocorrect: "off", autocomplete: "off", data: { "1p-ignore": "true", filter_target: "input", action: "input->filter#filter" } %> <% end %>