method
permit_value
rails latest stable - Class:
ActionController::Parameters
permit_value(value, filter, on_unpermitted:, explicit_arrays:)private
No documentation available.
# File actionpack/lib/action_controller/metal/strong_parameters.rb, line 1364
def permit_value(value, filter, on_unpermitted,, explicit_arrays))
if filter == EMPTY_ARRAY # Declaration { comment_ids: [] }.
permit_array_of_scalars(value)
elsif filter == EMPTY_HASH # Declaration { preferences: {} }.
permit_hash(value, filter, on_unpermitted,, explicit_arrays))
elsif array_filter?(filter) # Declaration { comments: [[:text]] }
permit_array_of_hashes(value, filter.first, on_unpermitted,, explicit_arrays))
elsif explicit_arrays # Declaration { user: { address: ... } } or { user: [:name, ...] } (only allows hash value)
permit_hash(value, filter, on_unpermitted,, explicit_arrays))
elsif non_scalar?(value) # Declaration { user: { address: ... } } or { user: [:name, ...] }
permit_hash_or_array(value, filter, on_unpermitted,, explicit_arrays))
end
end