2023-08-09 21:47:33 +08:00
|
|
|
<%= form_with model: object, url: update_url, data: { remote: true }, method: update_method, html: {class: 'tiny-mce-editor'}, builder: SciFormHelper::SciFormBuilder do |f| %>
|
2023-06-21 20:13:20 +08:00
|
|
|
<%= render partial: 'shared/tiny_mce_extra_buttons' %>
|
2019-11-12 18:26:18 +08:00
|
|
|
<div class="ql-editor tinymce-view"
|
|
|
|
data-placeholder="<%= placeholder %>"><%= custom_auto_link(object.tinymce_render(field),
|
|
|
|
simple_format: false,
|
|
|
|
tags: %w(img),
|
|
|
|
team: current_team) if object[field].present? %></div>
|
|
|
|
<%= f.tiny_mce_editor(field,
|
|
|
|
id: "#{object.class.to_s.underscore}_#{object.id}_textarea",
|
|
|
|
class: 'hidden',
|
|
|
|
placeholder: placeholder,
|
|
|
|
hide_label: true,
|
|
|
|
value: sanitize_input(object.tinymce_render(field)),
|
|
|
|
data: {
|
|
|
|
object_type: object.class.to_s.underscore,
|
|
|
|
object_id: object.id,
|
|
|
|
last_updated: object.updated_at.to_i * 1000 } ) %>
|
2019-11-15 23:23:48 +08:00
|
|
|
<% end %>
|