Method: Formotion::Form#initialize
- Defined in:
- lib/formotion/form/form.rb
#initialize(params = {}) ⇒ Form
Returns a new instance of Form.
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/formotion/form/form.rb', line 30 def initialize(params = {}) # super takes care of initializing the ::PROPERTIES in params super sections = params[:sections] || params["sections"] sections && sections.each_with_index {|section_hash, index| section = create_section(section_hash.merge({index: index})) } initialize_persist unless self.persist_as.nil? end |