Module: Dry::Rails::Features::SafeParams
- Defined in:
- lib/dry/rails/features/safe_params.rb
Overview
SafeParams controller feature
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
- .included(klass) ⇒ Object private
Instance Method Summary collapse
-
#safe_params ⇒ Dry::Schema::Result
Return schema result.
-
#schemas ⇒ Hash<Symbol => Dry::Schema::Params]
Return registered action schemas.
Class Method Details
.included(klass) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 16 17 18 19 20 |
# File 'lib/dry/rails/features/safe_params.rb', line 13 def self.included(klass) super klass.extend(ClassMethods) klass.class_eval do before_action(:set_safe_params, prepend: true) end end |
Instance Method Details
#safe_params ⇒ Dry::Schema::Result
Return schema result
56 57 58 |
# File 'lib/dry/rails/features/safe_params.rb', line 56 def safe_params @safe_params end |
#schemas ⇒ Hash<Symbol => Dry::Schema::Params]
Return registered action schemas
65 66 67 |
# File 'lib/dry/rails/features/safe_params.rb', line 65 def schemas self.class.schemas end |