Ruby Error

ActionController::ParameterMissing

ActionController::ParameterMissing is raised when using require() on params and the required key is missing. This is part of Rails strong parameters.

Common causes

  • Form submitted without required nested params
  • API request missing required body
  • Wrong parameter key name in form
  • JavaScript disabled preventing form submission
  • CSRF token issues causing form data loss

How to fix it

  • Verify form field names match expected params
  • Use permit with fetch for optional nested params
  • Add proper error handling for missing params
  • Validate params presence before require
  • Check form_with model naming conventions

Example

ActionController::ParameterMissing example
# Error example
def user_params
  params.require(:user).permit(:name, :email)
end
# If params = {} => ActionController::ParameterMissing: param is missing or empty: user

# Fix with conditional check
def user_params
  if params[:user].present?
    params.require(:user).permit(:name, :email)
  else
    {}
  end
end

# Or rescue in controller
rescue_from ActionController::ParameterMissing do |e|
  render json: { error: e.message }, status: :bad_request
end

Track ActionController::ParameterMissing with Checkend

Checkend automatically captures ActionController::ParameterMissing errors in your Ruby application with full context:

  • Complete backtrace with syntax highlighting
  • Request context (URL, params, headers)
  • Automatic grouping of similar errors
  • Instant notifications when errors occur

Stop debugging in production

Get full error context and fix issues faster with self-hosted error tracking.