<!-- expects a local variable "form" -->

<!-- put in all the information uploaded in hidden fields -->
<%= form.fields_for :author_attributes do |creator_form| %>
  <% (@chapter.current_user_pseuds || []).each do |pseud| %>
    <%= creator_form.hidden_field :ids, value: pseud.id, multiple: true %>
  <% end %>

  <% @chapter.creatorships.each do |creatorship| %>
    <% if creatorship.new_record? %>
      <%= creator_form.hidden_field :coauthors, value: creatorship.pseud_id, multiple: true %>
    <% end %>
  <% end %>
<% end %>

<%= form.hidden_field :title, :value => "#{@chapter.title}" %>
<%= form.hidden_field :summary, :value => "#{@chapter.summary}" %>
<%= form.hidden_field :notes, :value => "#{@chapter.notes}" %>
<%= form.hidden_field :endnotes, :value => "#{@chapter.endnotes}" %>
<%= form.hidden_field :content, :value => "#{@chapter.content}" %>

<%= form.hidden_field :wip_length, :value => "#{@chapter.wip_length}" %>
<%= form.hidden_field :position, :value => "#{@chapter.position}" %>
<%= form.hidden_field :published_at, :value => "#{@chapter.published_at}" %></p>
