Class: Tramway::Site::PersonForm
- Inherits:
-
Core::ExtendedApplicationForm
- Object
- Core::ExtendedApplicationForm
- Tramway::Site::PersonForm
- Defined in:
- app/forms/tramway/site/person_form.rb
Instance Method Summary collapse
- #full_name ⇒ Object
- #full_name=(value) ⇒ Object
-
#initialize(object) ⇒ PersonForm
constructor
A new instance of PersonForm.
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_name ⇒ Object
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 |