当我使用操作文本保存模型时,内容会保存到数据库中,但无法通过控制台访问。
我有一个截面模型has_rich_text :content
当我尝试创建新记录时,它会创建富文本关联,但正文始终为空白。
section.content = '<p>Hello world</p>'
section.save
=> true
section.content
=> #<ActionText::RichText id: 6, name: "content", body: #<ActionText::Content " ">, record_type: "Section", record_id: 2, created_at: "2020-05-07 13:49:58", updated_at: "2020-05-07 14:00:36">
section.content.to_s
=> " "
section.content.body
=> #<ActionText::Content " ">
它在数据库中正确设置,并且我的代码在序列化程序中访问该值并发送正确的content
. 但是,我想通过控制台访问此内容。