class Formotion::FormableController

Attributes

model[RW]

Public Instance Methods

initWithModel(model) click to toggle source
# File lib/formotion/controller/formable_controller.rb, line 8
def initWithModel(model)
  self.initWithForm(model.to_form)
  self.model = model
  self.form.sections.each { |section|
    section.rows.each { |row|
      observe(row, "value") do |old_value, new_value|
        self.model.send("#{row.key}=", new_value)
      end
    }
  }
  self
end