Class: Spina::LayoutPart
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Spina::LayoutPart
show all
- Includes:
- ApplicationHelper
- Defined in:
- app/models/spina/layout_part.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
#captcha, #current_account, #error_explanation!, #image_tag_with_at2x, #link_to_add_fields, #markdown
Instance Attribute Details
#position(theme) ⇒ Object
Returns the value of attribute position.
9
10
11
|
# File 'app/models/spina/layout_part.rb', line 9
def position
@position
end
|
Instance Method Details
#content ⇒ Object
25
26
27
|
# File 'app/models/spina/layout_part.rb', line 25
def content
self.layout_partable.try(:content) || self.layout_partable
end
|
#layout_partable_attributes=(attributes) ⇒ Object
29
30
31
32
33
34
35
|
# File 'app/models/spina/layout_part.rb', line 29
def layout_partable_attributes=(attributes)
if self.layout_partable.present?
self.layout_partable.update_attributes(attributes)
else
self.layout_partable = self.layout_partable_type.constantize.create(attributes)
end
end
|
#to_s ⇒ Object
16
17
18
|
# File 'app/models/spina/layout_part.rb', line 16
def to_s
name
end
|