Class: Tramway::Site::PersonForm

Inherits:
Core::ExtendedApplicationForm
  • Object
show all
Defined in:
app/forms/tramway/site/person_form.rb

Instance Method Summary collapse

Constructor Details

#initialize(object) ⇒ PersonForm

Returns a new instance of PersonForm.



6
7
8
9
10
11
12
13
# File 'app/forms/tramway/site/person_form.rb', line 6

def initialize(object)
  super(object).tap do
    form_properties full_name: :string,
                    photo: :file,
                    short_bio: :string,
                    bio: :ckeditor
  end
end

Instance Method Details

#full_nameObject



19
20
21
# File 'app/forms/tramway/site/person_form.rb', line 19

def full_name
  model.names.join ' '
end

#full_name=(value) ⇒ Object



15
16
17
# File 'app/forms/tramway/site/person_form.rb', line 15

def full_name=(value)
  model.names = value.split ' '
end