Method: Formotion::Form#create_section

Defined in:
lib/formotion/form/form.rb

#create_section(hash = {}) ⇒ Object

Use this to add sections via a hash EX @form.create_section(:title => ‘Section Title’)



77
78
79
80
81
82
83
# File 'lib/formotion/form/form.rb', line 77

def create_section(hash = {})
  hash = hash.merge({:form => self})
  section = Formotion::Section.new(hash)
  section.index = self.sections.count
  self.sections << section
  section
end