Class: Dato::ItemLink
- Defined in:
- app/components/dato/item_link.rb
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(node, root) ⇒ ItemLink
constructor
A new instance of ItemLink.
- #inline_item ⇒ Object
- #link_attributes ⇒ Object
Methods inherited from DastNode
Methods inherited from Node
#blocks, #debug_node, #links, #overrides, #render_node
Constructor Details
Instance Method Details
#inline_item ⇒ Object
8 9 10 |
# File 'app/components/dato/item_link.rb', line 8 def inline_item links.find { |b| b.id == @node.item } end |
#link_attributes ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'app/components/dato/item_link.rb', line 12 def link_attributes attr = { "href" => path_for_inline_item(inline_item), "class" => "dato-cms-#{@node.type}" } %w[rel target].each { |type| attr[type] = (type) } attr end |