Method: Fend::Plugins::Core::ParamMethods#params
- Defined in:
- lib/fend.rb
#params(*names) {|params.values| ... } ⇒ Object
Define child params and execute validation block
190 191 192 193 194 195 196 197 198 199 200 201 |
# File 'lib/fend.rb', line 190 def params(*names, &block) return if flat? && invalid? params = names.each_with_object({}) do |name, result| param = _build_param(name, self[name]) result[name] = param end yield(*params.values) params.each { |name, param| _nest_errors(name, param.errors) if param.invalid? } end |