<%= form_with model: [@comment],
  local: false,
  html: {
    data: {
      behavior: 'local-auto-save',
      auto_save_key: "comment-#{@comment.id}"
    }
  } do |f| %>

  <%= f.text_area :content,
                  value: @comment.content,
                  rows: 5,
                  required: 'required',
                  class: 'form-control mt-3',
                  data: {
                    behavior: 'mentionable rich-toolbar drop-zone',
                    'rich-toolbar': 'defaults image',
                    'rich-toolbar-uploader': '[data-behavior~=jquery-upload]',
                  } %>
  <%= f.submit "Update comment", class: "btn btn-primary mt-2 ms-0", style: 'vertical-align: baseline;' %> or
  <%= link_to 'Cancel',
                comment_path(@comment),
                class: 'cancel-link',
                remote: true,
                data: {
                  behavior: 'cancel-comment clear-local-auto-save'
                } %>
<% end %>
