Class: Spina::PagePart
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Spina::PagePart
show all
- Includes:
- ApplicationHelper
- Defined in:
- app/models/spina/page_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/page_part.rb', line 9
def position
@position
end
|
Instance Method Details
#content ⇒ Object
25
26
27
|
# File 'app/models/spina/page_part.rb', line 25
def content
self.page_partable.try(:content) || self.page_partable
end
|
#page_partable_attributes=(attributes) ⇒ Object
29
30
31
32
33
34
35
|
# File 'app/models/spina/page_part.rb', line 29
def page_partable_attributes=(attributes)
if self.page_partable.present?
self.page_partable.assign_attributes(attributes)
else
self.page_partable = self.page_partable_type.constantize.new(attributes)
end
end
|
#to_s ⇒ Object
16
17
18
|
# File 'app/models/spina/page_part.rb', line 16
def to_s
name
end
|