method
to_h
v5.0.0.1 -
Show latest stable
- Class:
ActionController::Parameters
to_h()public
Returns a safe ActiveSupport::HashWithIndifferentAccess representation of this parameter with all unpermitted keys removed.
params = ActionController::Parameters.new({ name: 'Senjougahara Hitagi', oddity: 'Heavy stone crab' }) params.to_h # => {} safe_params = params.permit(:name) safe_params.to_h # => {"name"=>"Senjougahara Hitagi"}