Module: Spina::Embeddable

Extended by:
ActiveSupport::Concern
Included in:
Spina::Embeds::Base
Defined in:
lib/spina/embeddable.rb

Instance Method Summary collapse

Instance Method Details

#initialize(attributes = {}) ⇒ Object



31
32
33
34
35
# File 'lib/spina/embeddable.rb', line 31

def initialize(attributes = {})
  attributes.slice(*self.class.embed_attributes).each do |key, value|
    instance_variable_set("@#{key}", value)
  end
end

#to_fields_pathObject



37
38
39
# File 'lib/spina/embeddable.rb', line 37

def to_fields_path
  "#{to_partial_path}_fields"
end

#to_trix_partial_pathObject



41
42
43
# File 'lib/spina/embeddable.rb', line 41

def to_trix_partial_path
  to_partial_path
end