title: undefined method `with_indifferent_access' for #<Array:
body: <p>I've tried it in a number of ways but it does not work. I have in this project, another controller with the same code working, the difference that another uses the has_many relationship, and the one with problem is has_one and belongs_to. Let's go to the code.</p>
  
  <pre><code>class Endereco &lt; ActiveRecord::Base
   has_one :user
  end
  
  class User &lt; ActiveRecord::Base
   belongs_to :endereco
   accepts_nested_attributes_for :endereco
  </code></pre>
  
  <p>The strong parameter in controller:</p>
  
  <pre><code>class Backoffice::UsersController &lt; BackofficeController
  
  def create
   @user = User.new(params_user)
   respond_to do |format|  
    if @user.save!
      format.json { render json: @user, include: :endereco}
    else
      format.json { render json: @user.errors, status: :unprocessable_entity }
    end
   end
  end
  
  
  
   def params_user
     params.require(:user).permit(:nome, 
          :email, 
          :password, 
          :password_confirmation, 
          :cpf, 
          :tel_fixo, 
          :tel_cel,
          endereco_attributes: [
            :rua,
            :bairro,
            :cidade,
            :uf,
            :cep,
            :referencia,
            :numero,
            :complemento          
            ])
    end 
  </code></pre>
  
  <p>When I send this json via POSTMAN I get the error> undefined method `with_indifferent_access' for #Array: on this line </p>
  
  <blockquote>
    <p>@user = User.new(params_user)</p>
  </blockquote>
  
  <pre><code>{   "user":{
      "nome" : "teste1", 
      "email" : "teste@tt.com", 
      "password": "123", 
      "password_confirmation": "123", 
      "cpf": "123321", 
      "tel_fixo": "123321", 
      "tel_cel": "asdsd",
      "endereco_attributes": [
          {
            "rua": "tt",
            "bairro": "tete",
            "cidade": "asdas",
            "uf":"asdasd",
            "cep": "12321",
            "referencia": "asdasd",
            "numero":"123",
            "complemento":"123" }
      ]
  }}
  </code></pre>
  
  <p>Someone to give me a light? Thank you!</p>