-
-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Description
Dependencies:
- Rails (7.0.3)
- Ruby (3.1)
- activeadmin_quill_editor (1.0.0)
Situation:
If used with Action Text there is a problem. When editing, the editor is empty because it is not possible to read the input content due to <div class="trix-content">some html content</div>
Of course, this is not a problem of the gem, but since it is recommended to use it when you need to work with Action Text in the active admin, it is worth offering a solution.
My solution (hardcode):
project/app/models/some_model.rb
has_rich_text :text
def some_text=(body)
text.body = body
end
def some_text
text.to_s.gsub(/\A<div class="trix-content">(.*)<\/div>\z/m, '\1').strip.html_safe
end
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels