Class: Spree::PageBlocks::Link

Inherits:
Spree::PageBlock show all
Includes:
HasOneLink
Defined in:
app/models/spree/page_blocks/link.rb

Constant Summary

Constants inherited from Spree::PageBlock

Spree::PageBlock::BOTTOM_PADDING_DEFAULT, Spree::PageBlock::CONTAINER_ALIGNMENT_DEFAULT, Spree::PageBlock::SIZE_DEFAULT, Spree::PageBlock::TEXT_ALIGNMENT_DEFAULT, Spree::PageBlock::TOP_PADDING_DEFAULT, Spree::PageBlock::WIDTH_DESKTOP_DEFAULT

Instance Method Summary collapse

Methods inherited from Spree::PageBlock

#form_partial_name

Instance Method Details

#display_nameObject



10
11
12
# File 'app/models/spree/page_blocks/link.rb', line 10

def display_name
  link&.label || Spree.t('page_blocks.link.display_name')
end

#icon_nameObject



6
7
8
# File 'app/models/spree/page_blocks/link.rb', line 6

def icon_name
  'menu-2'
end


14
15
16
17
18
# File 'app/models/spree/page_blocks/link.rb', line 14

def link_destroyed(_link)
  return unless page_links_count.zero?

  destroy
end