{
    "mode": "ri",
    "parameter": "ActionController::ParamsWrapper",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/ri/ActionController%3A%3AParamsWrapper/json",
    "generated": "2026-07-29T01:57:57Z",
    "sections": {
        "ActionController::ParamsWrapper": {
            "content": "------------------------------------------------------------------------",
            "subsections": []
        },
        "Extended by:": {
            "content": "ActiveSupport::Concern (from /home/chedong/.local/share/rdoc)\n\n(from /home/chedong/.local/share/rdoc)\n------------------------------------------------------------------------\nWraps the parameters hash into a nested hash. This will allow clients to\nsubmit requests without having to specify any root elements.\n\nThis functionality is enabled in config/initializers/wrapparameters.rb\nand can be customized.\n\nYou could also turn it on per controller by setting the format array to\na non-empty array:\n\nclass UsersController < ApplicationController\nwrapparameters format: [:json, :xml, :urlencodedform, :multipartform]\nend\n\nIf you enable ParamsWrapper for :json format, instead of having to send\nJSON parameters like this:\n\n{\"user\": {\"name\": \"Konata\"}}\n\nYou can send parameters like this:\n\n{\"name\": \"Konata\"}\n\nAnd it will be wrapped into a nested hash with the key name matching the\ncontroller's name. For example, if you're posting to UsersController,\nyour new params hash will look like this:\n\n{\"name\" => \"Konata\", \"user\" => {\"name\" => \"Konata\"}}\n\nYou can also specify the key in which the parameters should be wrapped\nto, and also the list of attributes it should wrap by using either\n:include or :exclude options like this:\n\nclass UsersController < ApplicationController\nwrapparameters :person, include: [:username, :password]\nend\n\nOn Active Record models with no :include or :exclude option set, it will\nonly wrap the parameters returned by the class method attributenames.\n\nIf you're going to pass the parameters to an ActiveModel object (such as\nUser.new(params[:user])), you might consider passing the model class to\nthe method instead. The ParamsWrapper will actually try to determine the\nlist of attribute names from the model and only wrap those attributes:\n\nclass UsersController < ApplicationController\nwrapparameters Person\nend\n\nYou still could pass :include and :exclude to set the list of attributes\nyou want to wrap.\n\nBy default, if you don't specify the key in which the parameters would\nbe wrapped to, ParamsWrapper will actually try to determine if there's a\nmodel related to it or not. This controller, for example:\n\nclass Admin::UsersController < ApplicationController\nend\n\nwill try to check if Admin::User or User model exists, and use it to\ndetermine the wrapper key respectively. If both models don't exist, it\nwill then fallback to use user as the key.\n------------------------------------------------------------------------",
            "subsections": []
        },
        "Constants:": {
            "content": "EXCLUDEPARAMETERS:\n[not documented]\n\n",
            "subsections": []
        }
    },
    "flags": [],
    "examples": [],
    "see_also": []
}