<%= form_for @changeset,
  Routes.news_item_comment_path(@conn, :update, hashid(@comment.id)),
  [class: "comment_form js-comment-form is-hidden", method: "patch", data: [ajax: true, context: "edit"]],
  fn(f) -> %>

  <%= hidden_input(f, :item_id, id: false) %>
  <%= hidden_input(f, :comment_id, id: false, value: @comment.id) %>
  <textarea class="comment_form-write" name="<%= input_name(f, :content) %>" rows="2"><%= @comment.content %></textarea>

  <div class="comment_form-preview richtext richtext--comment js-comment-preview-area"></div>

  <div class="comment_form-toolbar">
    <div class="comment_form-toolbar-toggle">
      <button class="comment_form-toolbar-toggle-write js-comment-write is-active">Write</button> |
      <button class="comment_form-toolbar-toggle-preview js-comment-preview">Preview</button>
    </div>
    <input type="submit" class="comment_form-toolbar-submit" value="Update">
  </div>
<% end %>
