Class: Lcms::Engine::CurriculumForm

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
app/forms/lcms/engine/curriculum_form.rb

Overview

Handle the form data from the CurriculumEditor admin component

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ CurriculumForm

Returns a new instance of CurriculumForm.



12
13
14
15
# File 'app/forms/lcms/engine/curriculum_form.rb', line 12

def initialize(params = {})
  parsed_change_log = parse_change_log params
  super params.merge(change_log: parsed_change_log)
end

Instance Method Details

#saveObject



17
18
19
20
21
22
# File 'app/forms/lcms/engine/curriculum_form.rb', line 17

def save
  return false unless valid?

  persist!
  errors.empty?
end