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



23
24
25
# File 'lib/sequent/core/helpers/param_support.rb', line 23

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

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



16
17
18
# File 'lib/sequent/core/helpers/param_support.rb', line 16

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