<%= form_with(model: message) do |form| %>
  <% if message.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(message.errors.count, "error") %> prohibited this message from being saved:</h2>

      <ul>
      <% message.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= form.label :subject %>
    <%= form.text_field :subject %>
  </div>

  <div class="field">
    <%= form.label :content, "Message content label" %>
    <%= form.rich_text_area :content, class: "trix-content",
          placeholder: "Your message here", aria: { label: "Message content aria-label" } %>
  </div>

  <div class="actions">
    <%= form.submit %>
  </div>
<% end %>
