最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

ruby on rails - ActionText does not initialise in Spreebacked - Stack Overflow

programmeradmin6浏览0评论

I have added action_text to my Spree app on rails 7.

bin/rails action_text:install

And added the css to the admin area by adding a custom file to

vendor/assets/stylesheets/spree/backend/

Checking my form, the trix markup is displayed for the field:

  <div class="form-group">
    <%= form.label :body %>
    <%= form.rich_text_area :body, class: 'form-control' %>
  </div>

Renders:

<trix-editor class="form-control" id="post_body" input="post_body_trix_input_post_5" data-direct-upload-url="http://localhost:3000/rails/active_storage/direct_uploads" data-blob-url-template="http://localhost:3000/rails/active_storage/blobs/redirect/:signed_id/:filename"></trix-editor>

And looking in y browser dev tools, I can see the Trix and then ActionText js is loaded, but the trix editor does not display and the initialise event does not happen

document.addEventListener("trix-initialize", function(event) {
  console.log("Trix editor initialized - never happens");
});

I've attempted all sorts of asset clobering and debug. I'm out of ideas - how can I debug and fix action_text?

发布评论

评论列表(0)

  1. 暂无评论