diff --git a/app/views/access_permissions/partials/_member_field.html.erb b/app/views/access_permissions/partials/_member_field.html.erb index 6b3bbf8a5..421ad7900 100644 --- a/app/views/access_permissions/partials/_member_field.html.erb +++ b/app/views/access_permissions/partials/_member_field.html.erb @@ -6,8 +6,9 @@ item_id = dom_id(user, :assignment_member) %> -<%= form_with(model: assignment, url: update_path, method: :put, html: { class: 'member-item', id: item_id, data: { remote: true, action: 'replace-form autosave-form', object_type: :assignment_member } }) do |f| %> - <%= f.hidden_field :user_id, value: f.object.user.id %> +<% if assignment.present? %> + <%= form_with(model: assignment, url: update_path, method: :put, html: { class: 'member-item', id: item_id, data: { remote: true, action: 'replace-form autosave-form', object_type: :assignment_member } }) do |f| %> + <%= f.hidden_field :user_id, value: f.object.user.id %>