Class: Crm::ContentLinkEditorComponent

Inherits:
ApplicationComponent show all
Includes:
ActionView::Helpers::FormTagHelper, ActionView::RecordIdentifier
Defined in:
app/components/crm/content_link_editor_component.rb

Overview

ViewComponent: renders the content link editor block.

Renders grouped content links for a source record, either from live
ContentLink rows or from an ArticleRevision's staged link data,
together with the Stimulus-driven form used to add and reorder links.

Defined Under Namespace

Classes: Entry

Instance Method Summary collapse

Methods inherited from ApplicationComponent

#cms_link, #fetch_or_fallback, #image_asset_tag, #image_tag, #number_to_currency, #number_with_delimiter, #post_path, #post_url, #strip_tags

Constructor Details

#initialize(source:, revision: nil) ⇒ ContentLinkEditorComponent

Returns a new instance of ContentLinkEditorComponent.

Parameters:

  • source (ActiveRecord::Base)

    record the content links belong to
    (responds to outbound_content_links when rendering live links)

  • revision (ArticleRevision, nil) (defaults to: nil)

    revision whose staged link data
    is rendered instead of live ContentLink rows



25
26
27
28
29
# File 'app/components/crm/content_link_editor_component.rb', line 25

def initialize(source:, revision: nil)
  super()
  @source = source
  @revision = revision
end