从Trix编辑器字段添加或更改的数据不会提交/传输。
<%= form_with(model: @comment,local: true) do |form| %>
<div class="form-group">
<h4>Titel</h4>
<%= form.text_field :header,class: "form-control border-top-0 border border-right-0 border-left-0 rounded-0 p-0" %>
<br/>
<h4>Inhalt</h4>
<%= form.trix_editor :comment %>
<%= form.text_field :tonie_id,value: tonie_id,hidden: true %>
<%= form.text_field :user_id,value: current_user.id,hidden: true %>
<%= form.check_box :private %> privater Kommentar
<br/>
<%= form.submit "speichern ",class: 'btn btn-success' %>
</div>
<% end %>
查看我的日志,我得到以下信息:
Parameters: {"authenticity_token"=>"xxxx","tcomment"=>{"header"=>"title","comment"=>"","tonie_id"=>"49","user_id"=>"1","private"=>"0"},"commit"=>"speichern "}
任何想法,有什么问题吗?