Class: Marksmith::Fields::MarkdownField

Inherits:
Avo::Fields::BaseField
  • Object
show all
Defined in:
lib/marksmith/fields/markdown_field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, **args, &block) ⇒ MarkdownField

Returns a new instance of MarkdownField.



7
8
9
10
11
12
13
14
15
# File 'lib/marksmith/fields/markdown_field.rb', line 7

def initialize(id, **args, &block)
  @media_library = args[:media_library].nil? ? true : args[:media_library]
  @extra_preview_params = args[:extra_preview_params] || {}
  @file_uploads = args[:file_uploads]

  super(id, **args, &block)

  hide_on :index
end

Instance Attribute Details

#extra_preview_paramsObject (readonly)

Returns the value of attribute extra_preview_params.



4
5
6
# File 'lib/marksmith/fields/markdown_field.rb', line 4

def extra_preview_params
  @extra_preview_params
end

#file_uploadsObject (readonly)

Returns the value of attribute file_uploads.



4
5
6
# File 'lib/marksmith/fields/markdown_field.rb', line 4

def file_uploads
  @file_uploads
end

Instance Method Details

Returns:

  • (Boolean)


21
22
23
# File 'lib/marksmith/fields/markdown_field.rb', line 21

def gallery_enabled?
  Avo::MediaLibrary.configuration.enabled && @media_library
end

#view_component_namespaceObject



17
18
19
# File 'lib/marksmith/fields/markdown_field.rb', line 17

def view_component_namespace
  "Marksmith::MarkdownField"
end