Class: Locomotive::EditableControlPresenter

Inherits:
EditableElementPresenter show all
Defined in:
app/presenters/locomotive/editable_control_presenter.rb

Instance Attribute Summary

Attributes inherited from BasePresenter

#ability, #depth

Instance Method Summary collapse

Methods inherited from EditableElementPresenter

#block_name, #label, #slug, #type

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

#contentObject

properties ##



6
# File 'app/presenters/locomotive/editable_control_presenter.rb', line 6

property :content

#optionsObject

other getters / setters ##



11
12
13
14
15
16
# File 'app/presenters/locomotive/editable_control_presenter.rb', line 11

def options
  self.source.options.map do |option|
    option['selected'] = option['value'] == self.source.content
    option
  end
end