Class: Decidim::Plans::ContentForm
- Inherits:
-
Form
- Object
- Form
- Decidim::Plans::ContentForm
- Includes:
- OptionallyTranslatableAttributes, TranslationsHelper
- Defined in:
- app/forms/decidim/plans/content_form.rb
Overview
A form object to be used when admin users want to create or edit a plan content field.
Instance Attribute Summary collapse
Instance Method Summary collapse
- #deleted? ⇒ Boolean
- #help ⇒ Object
- #label ⇒ Object
-
#map_model(model) ⇒ Object
Public: Map the correct fields.
Methods included from OptionallyTranslatableAttributes
Instance Attribute Details
Instance Method Details
#deleted? ⇒ Boolean
53 54 55 |
# File 'app/forms/decidim/plans/content_form.rb', line 53 def deleted? false end |
#help ⇒ Object
38 39 40 |
# File 'app/forms/decidim/plans/content_form.rb', line 38 def help translated_attribute(section.help) end |
#label ⇒ Object
34 35 36 |
# File 'app/forms/decidim/plans/content_form.rb', line 34 def label translated_attribute(section.body) end |
#map_model(model) ⇒ Object
Public: Map the correct fields.
Returns nothing.
45 46 47 48 49 50 51 |
# File 'app/forms/decidim/plans/content_form.rb', line 45 def map_model(model) self.section_id = model.decidim_section_id self.section = model.section self.plan_id = model.decidim_plan_id self.plan = model.plan end |