Class: Alchemy::Ingredients::Richtext
- Inherits:
-
Alchemy::Ingredient
- Object
- ActiveRecord::Base
- BaseRecord
- Alchemy::Ingredient
- Alchemy::Ingredients::Richtext
- Defined in:
- app/models/alchemy/ingredients/richtext.rb
Overview
A blob of richtext
Constant Summary
Constants included from SearchableResource
SearchableResource::SEARCHABLE_COLUMN_TYPES
Instance Method Summary collapse
- #custom_tinymce_config ⇒ Object
- #has_tinymce? ⇒ Boolean
-
#preview_text(max_length = 30) ⇒ Object
The first 30 characters of the stripped_body.
Methods inherited from Alchemy::Ingredient
allow_settings, allowed_settings, #as_view_component, #definition, #deprecated?, #has_hint?, #has_validations?, normalize_type, #partial_name, #preview_ingredient?, related_object_alias, #settings, #to_partial_path, translated_label_for, #value
Methods included from Hints
Methods included from SearchableResource
#ransackable_associations, #ransackable_attributes, #ransortable_attributes
Instance Method Details
#custom_tinymce_config ⇒ Object
35 36 37 |
# File 'app/models/alchemy/ingredients/richtext.rb', line 35 def custom_tinymce_config settings[:tinymce] || {} end |
#has_tinymce? ⇒ Boolean
31 32 33 |
# File 'app/models/alchemy/ingredients/richtext.rb', line 31 def has_tinymce? true end |
#preview_text(max_length = 30) ⇒ Object
The first 30 characters of the stripped_body
Used by the Element#preview_text method.
27 28 29 |
# File 'app/models/alchemy/ingredients/richtext.rb', line 27 def preview_text(max_length = 30) stripped_body.to_s[0..max_length - 1] end |