I'm having some issues with the nested field here. I've used nested fields in other views/controllers without issue.

I'm trying to associate a role to the user table from the roles table.

My role model looks like this:

```
class Role < ApplicationRecord
  has_many :users
end

```

My user model has this:

```
class User < ApplicationRecord
  belongs_to :role, optional: true
  accepts_nested_attributes_for :role

...

```

The reason why it's set to optional is because current users don't yet have a role, and I need to apply it to those first (there are only two users in production at the moment so that's fine)

My user controller is like this for the permitted attributes and update

```
class Admin::UsersController < ApplicationController
  before_action :set_user, only: [:edit, :update, :destroy]
...
  def edit
  end

  def update
    respond_to do |format|
      if @user.update(user_params)
        format.html { redirect_to admin_users_url, notice: 'User Account was successfully updated.' }
      else
        format.html { render :edit }
      end
    end
  end

  private

  def user_params
    params.require(:user).permit(:first_name, :last_name, :email, :password, roles_attributes: [:name])
  end

  def set_user
      @user = User.find(params[:id])
    end
end

```

And the form to update the user roles:

```
.container.p-4
    %h1 Edit User Information

    = form_for([:admin, @user]) do |f|
        - if @user.errors.any?
            #error_explanation
            %h2
            = pluralize(@user.errors.count, "error")
            prohibited this event from being saved:
            %ul
                - @user.errors.each do |error|
                    %li= error.full_message

        .row.mb-4
            .col
                = f.label :first_name, "First Name"
                = f.text_field :first_name, class: "form-control border border-dark"
            .col
                = f.label :last_name, "Last Name"
                = f.text_field :last_name, class: "form-control border border-dark"
        .form-group.mb-4
            = f.label :email, "Email Address"
            = f.email_field :email, class: "form-control border border-dark"

        %h2 User Role
        .form-group.mb-4
            = f.fields_for :roles do |f|
                = f.check_box :name, checked: false, value: "admin"
                = f.label :name, "Admin"

        .form-group.p-4.text-center
            = f.submit

```

When I hit update after checking "Admin", the terminal readout is that :roles is unpermitted.

I have a seperate Role controller that allows me to define the roles to associate users to. the Roles table only has name:string and user:references.

So I'm not sure why it's not being permitted.