Module: Sequent::Core::Helpers::ParamSupport::ClassMethods

Defined in:
lib/sequent/core/helpers/param_support.rb

Instance Method Summary collapse

Instance Method Details

#from_form_data(params = {}) ⇒ Object

Create an object based on HTTP form data This differs from form_params that an empty string is the same as nil since HTTP form post will send empty text fields



21
22
23
# File 'lib/sequent/core/helpers/param_support.rb', line 21

def from_form_data(params = {})
  from_params(params, false)
end

#from_params(params = {}, strict_nil_check = true) ⇒ Object



14
15
16
# File 'lib/sequent/core/helpers/param_support.rb', line 14

def from_params(params = {}, strict_nil_check = true)
  allocate.tap { |x| x.from_params(params, strict_nil_check) }
end