Class: Marksmith::Fields::MarkdownField
- Inherits:
-
Avo::Fields::BaseField
- Object
- Avo::Fields::BaseField
- Marksmith::Fields::MarkdownField
- Defined in:
- lib/marksmith/fields/markdown_field.rb
Instance Attribute Summary collapse
-
#extra_preview_params ⇒ Object
readonly
Returns the value of attribute extra_preview_params.
-
#file_uploads ⇒ Object
readonly
Returns the value of attribute file_uploads.
Instance Method Summary collapse
- #gallery_enabled? ⇒ Boolean
-
#initialize(id, **args, &block) ⇒ MarkdownField
constructor
A new instance of MarkdownField.
- #view_component_namespace ⇒ Object
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_params ⇒ Object (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_uploads ⇒ Object (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
#gallery_enabled? ⇒ 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_namespace ⇒ Object
17 18 19 |
# File 'lib/marksmith/fields/markdown_field.rb', line 17 def view_component_namespace "Marksmith::MarkdownField" end |