#1 Add to params

def create
  @inbox = Inbox.new(inbox_params)
  @inbox.user = current_user
end

#2 Relationship

def create
  @inbox = current_user.inboxes.new(post_params)
end

#3 Merge in params

def create
  @inbox = Inbox.new(inbox_params.merge({ user: current_user }))
end

#4 Merge in private params

def create
  @inbox = Inbox.new(inbox_params)
  @inbox.user = current_user
end

def inbox_params
  params.require(:inbox).permit(:name).merge(user: current_user)
end

#5 Add current_user by default in model association

Here’s how you can set current_user in the model