title: Rails 5 Api add token for authorization to permitted params when create object?
body: <p>this is my create action</p>
  
  <pre><code>def create
     @client = Client.new(client_params)
     if @client.save
       render json: @client,  status: :created
      else
       render json: @client.errors, status: :unprocessable_entity
      end
  end
  
  def client_params
     params.permit(:name,:age,:email,:tel)
  end
  </code></pre>
  
  <p>i want to send a token to authenticate api user and authorized to create the client, but when i send the request if I add the token to permitted params, like this:</p>
  
  <pre><code>params.permit(:name,:age,:email,:tel,:token)
  </code></pre>
  
  <p>I have this response:</p>
  
  <pre><code>ActiveModel::UnknownAttributeError (unknown attribute 'token' for Client.)
  </code></pre>
  
  <p>And when i do not add the token to permitted param this is the server output:</p>
  
  <pre><code>Unpermitted parameter: token
  </code></pre>
  
  <p>So, how can I add token to send to my rails api for create action??</p>
  
  <p>PD: I have an auithenticate_user action that authenticate the user and use the token in param[:token] and is execute as before action:</p>
  
  <pre><code>before_action :auth, only: [:create]
  </code></pre>
  
  <p>UPDATED
  This is the request:</p>
  
  <pre><code>Parameters: {"name"=&gt;"peter", "age"=&gt;"30","email"=&gt;"peter@mail.com","tel"=&gt;"456-261526", "token"=&gt;"srYm4DuJtjnNnHzdMss1HuuAJ"}
  </code></pre>