Class: RicherText::Nodes::RicherTextEmbed
- Inherits:
-
RicherText::Node
- Object
- RicherText::Node
- RicherText::Nodes::RicherTextEmbed
- Defined in:
- lib/richer_text/nodes/richer_text_embed.rb
Constant Summary
Constants inherited from RicherText::Node
Instance Attribute Summary
Attributes inherited from RicherText::Node
#attrs, #children, #json, #type
Instance Method Summary collapse
Methods inherited from RicherText::Node
#accept, build, #initialize, #style
Constructor Details
This class inherits a constructor from RicherText::Node
Instance Method Details
#embeddable ⇒ Object
14 15 16 |
# File 'lib/richer_text/nodes/richer_text_embed.rb', line 14 def @embeddable ||= GlobalID::Locator.locate_signed(sgid, for: "embeddable") end |
#html ⇒ Object
8 9 10 11 12 |
# File 'lib/richer_text/nodes/richer_text_embed.rb', line 8 def html render partial: ., object: , as: .model_name.element rescue ActiveRecord::RecordNotFound, NoMethodError "" # TODO: handle this better end |
#sgid ⇒ Object
4 5 6 |
# File 'lib/richer_text/nodes/richer_text_embed.rb', line 4 def sgid attrs["sgid"] end |