Class: Locomotive::EditableElementPresenter
- Inherits:
-
BasePresenter
- Object
- BasePresenter
- Locomotive::EditableElementPresenter
- Defined in:
- app/presenters/locomotive/editable_element_presenter.rb
Direct Known Subclasses
EditableControlPresenter, EditableFilePresenter, EditableShortTextPresenter
Instance Attribute Summary
Attributes inherited from BasePresenter
Instance Method Summary collapse
- #block_name ⇒ Object
-
#label ⇒ Object
other getters / setters ##.
-
#slug ⇒ Object
properties ##.
- #type ⇒ Object
Methods inherited from BasePresenter
#ability?, #after_initialize, getters_to_hash, #id, setters_to_hash, #site
Methods included from Presentable
#after_initialize, #as_json, #attributes=, #getters, #initialize, #property_options, #setters
Instance Method Details
#block_name ⇒ Object
22 23 24 25 26 27 28 |
# File 'app/presenters/locomotive/editable_element_presenter.rb', line 22 def block_name if self.source.block self.labelize(self.source.block.split('/').last) else I18n.t('locomotive.pages.form.default_block') end end |
#label ⇒ Object
other getters / setters ##
14 15 16 |
# File 'app/presenters/locomotive/editable_element_presenter.rb', line 14 def label self.labelize(self.slug) end |
#slug ⇒ Object
properties ##
6 |
# File 'app/presenters/locomotive/editable_element_presenter.rb', line 6 properties :slug, :block, :hint, :priority, :disabled, :from_parent, :allow_nil => true |
#type ⇒ Object
18 19 20 |
# File 'app/presenters/locomotive/editable_element_presenter.rb', line 18 def type self.source._type.to_s.demodulize end |