Rails: ActionController::ParameterMissing: param is missing or the value is empty: user
params.require(:user) found no user key (or it was blank), so Rails responds 400.
ActionController::ParameterMissing: param is missing or the value is empty: userparam is missing or the value is empty: postActionController::ParameterMissing (param is missing or the value is empty: user)ParameterMissing param is missingparam is missing or the value is empty or invalid 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_parametersdisabled- Client sending
useras blank string - Wrong param key in
require
⚡ Quick fix
- Send
user[name]=...or JSON{ "user": { "name": "A" } } - Set
Content-Type: application/json - Check
rails routesandparamsin logs
Detailed fix by platform
Rails
curl -X POST -H "Content-Type: application/json" -d '{"user":{"name":"A"}}' http://localhost:3000/users
How to diagnose
- Key — Present?
- Content-Type — JSON?
- Wrap — wrap_parameters?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- AbstractController::DoubleRenderError Rails: AbstractController::DoubleRenderError (Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect, and at most once per action)
- ActionController::UnknownFormat Rails: ActionController::UnknownFormat — UsersController#show is missing a template for this request format and variant
- ActiveModel::ForbiddenAttributesError (strong parameters) Rails: ActiveModel::ForbiddenAttributesError
Most viewed in Ruby / Rails
- ActiveRecord::PendingMigrationError Rails: ActiveRecord::PendingMigrationError — Migrations are pending. To resolve this issue, run: bin/rails db:migrate
- ActionController::InvalidAuthenticityToken Rails: ActionController::InvalidAuthenticityToken (Can't verify CSRF token authenticity)
- undefined method for nil Ruby: NoMethodError: undefined method `x' for nil (nil:NilClass)
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026