# Rails: ActionController::ParameterMissing: param is missing or the value is empty: user

**Code:** `ActionController::ParameterMissing: param is missing or the value is empty` · **Category:** Ruby / Rails · **Seen on:** Ruby

`params.require(:user)` found no `user` key (or it was blank), so Rails responds 400.

## Meaning

The form/JSON body doesn't wrap fields under `user`. Check field names (`user[name]`), Content-Type (`application/json`), `wrap_parameters`, and that the request body isn't empty. For APIs, send `{"user": {...}}` or rely on `wrap_parameters format: [:json]`.

## Common causes

- Form fields not nested under the model key
- Empty/missing JSON body or wrong Content-Type
- `wrap_parameters` disabled
- Client sending `user` as blank string
- Wrong param key in `require`

## Quick fix

1. Send `user[name]=...` or JSON `{ "user": { "name": "A" } }`
2. Set `Content-Type: application/json`
3. Check `rails routes` and `params` in logs

## Detailed fix by platform

### Rails

1. `curl -X POST -H "Content-Type: application/json" -d '{"user":{"name":"A"}}' http://localhost:3000/users`

## How to diagnose

1. **Key** — Present?
2. **Content-Type** — JSON?
3. **Wrap** — wrap_parameters?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/ruby/rails-parameter-missing)
