Rails 6 ActionText。表单可以使用多个RTF字段吗?

问题描述 投票:1回答:1

我在Rails 6应用程序中的表单中使用了多个富文本字段,但是只有第一个字段存储在数据库中,其余字段根本没有显示在数据库上。

module.rbhas_rich_text :contenthas_rich_text :referenceshas_rich_text :footnotes_ form.html.erbf.rich_text_area:内容f.rich_text_area:参考f.rich_text_area:脚注controller.rbparams.require ...:content,:references,:footnotes ...

ruby-on-rails ruby-on-rails-5 ruby-on-rails-6 trix actiontext
1个回答
0
投票

是的,这可以工作,但是请确保has_rich_text:attribute_name的名称与模型上的任何属性名称都不匹配。

© www.soinside.com 2019 - 2024. All rights reserved.