You should do simply like as
```ruby
def edit
  @trainee_course = current_user.trainee_courses.find_by_course_id @course.id
  @user_subject = @trainee_course.user_subjects.availables_or_create_with! @subject
end
```