Gurus, Need help with RoR API I see all the required parameters are being sent, however the server does not like one or some of it.
controller: def create @account = Account.new(account_params)
if @account.save
render json: @account, status: :created, location: @account
else
render json: @account.errors, status: :unprocessable_entity
end
end
def account_params
params.require(:account).permit(:client_id, :currency_id, :name, :type, :institution)
end
call looks like this: Started POST "/accounts?name=TD-Trading¤cy_id=1&institution=TD%20Waterhouse&type=Investment&client_id=1" for ::1 at 2020-11-27 01:16:08 -0700 Processing by AccountsController#create as / Parameters: {"name"=>"TD-Trading", "currency_id"=>"1", "institution"=>"TD Waterhouse", "type"=>"Investment", "client_id"=>"1"} Client Load (0.4ms) SELECT "clients".* FROM "clients" WHERE "clients"."email" = $1 ORDER BY "clients"."id" ASC LIMIT $2 [["email", "[email protected]"], ["LIMIT", 1]] Completed 400 Bad Request in 271ms (ActiveRecord: 0.4ms | Allocations: 1706)
ActionController::ParameterMissing (param is missing or the value is empty: account):
app/controllers/accounts_controller.rb:55:in account_params' app/controllers/accounts_controller.rb:21:in
create'