AlchemyCMS/alchemy_cms

View on GitHub
app/views/alchemy/ingredients/_richtext_editor.html.erb

Summary

Maintainability
Test Coverage
<%= content_tag :div,
  class: richtext_editor.css_classes,
  data: richtext_editor.data_attributes do %>
  <%= element_form.fields_for(:ingredients, richtext_editor.ingredient) do |f| %>
    <%= ingredient_label(richtext_editor, :value) %>

    <%- custom_tinymce_config = richtext_editor.custom_tinymce_config.inject({}) { |obj, (k, v)| obj[k.to_s.dasherize] = v.to_json; obj} %>
    <%= content_tag("alchemy-tinymce", custom_tinymce_config) do %>
      <%= f.text_area :value, id: richtext_editor.form_field_id(:value) %>
    <% end %>
  <% end %>
<% end %>