我最近配置了Actiontext,以便在我的Rails 6.0.0应用程序上工作。除了我的应用的Actiontext编辑器中的图像在我每次按回车键到新行时闪烁外,一切都很好。可以参考下面的视频。
我不知道如何排除这个问题。会不会是Actiontext或ActiveStorage配置错误?
编辑过了。
这是我的代码
// javascript/packs/application.js
require("trix")
require("@rails/actiontext")
/* assets/stylesheets/application.scss */
//=require actiontext
/* assets/stylesheets/actiontext.scss */
@import "trix/dist/trix";
.trix-content {
.attachment-gallery {
> action-text-attachment,
> .attachment {
flex: 1 0 33%;
padding: 0 0.5em;
max-width: 33%;
}
&.attachment-gallery--2,
&.attachment-gallery--4 {
> action-text-attachment,
> .attachment {
flex-basis: 50%;
max-width: 50%;
}
}
}
action-text-attachment {
.attachment {
padding: 0 !important;
max-width: 100% !important;
}
}
}
# app/models/card.rb
class Card < ApplicationRecord
has_rich_text :answer
end
<%# app/views/cards/_form.html.erb %>
<div class="form-group">
<%= f.label :answer %>
<%= f.rich_text_area :answer %>
</div>
在我升级到Rails 6.0.0后,这个问题就消失了。6.0.0.rc1
到 6.0.3
.
升级还升级了其他宝石。其中有些我认为是罪魁祸首。
- rails (6.0.0)
- actioncable (= 6.0.0)
- actionmailbox (= 6.0.0)
- actionmailer (= 6.0.0)
- actionpack (= 6.0.0)
- actiontext (= 6.0.0)
- actionview (= 6.0.0)
- activejob (= 6.0.0)
- activemodel (= 6.0.0)
- activerecord (= 6.0.0)
- activestorage (= 6.0.0)
- activesupport (= 6.0.0)
+ rails (6.0.3)
+ actioncable (= 6.0.3)
+ actionmailbox (= 6.0.3)
+ actionmailer (= 6.0.3)
+ actionpack (= 6.0.3)
+ actiontext (= 6.0.3)
+ actionview (= 6.0.3)
+ activejob (= 6.0.3)
+ activemodel (= 6.0.3)
+ activerecord (= 6.0.3)
+ activestorage (= 6.0.3)
+ activesupport (= 6.0.3)