app/views/releases/_form.html.haml
= release_form(release) do |f|
%main.form__fields
%fieldset.form__fieldset
%legend= t('.basic_information')
.form__field
= f.label :name
= f.text_field :name
.form_field.form__field--textarea
= f.label :description
= f.text_area :description
%fieldset.form__fieldset
%legend= t('.tracks')
.tracks
.tracks__list{ data: { target: 'nested.list' } }
= f.fields_for :released_tracks do |rt|
.released-track{ data: { target: 'nested.item' } }
.released-track__number
= rt.number_field :number, value: 1, required: true
.released-track__fields
= rt.fields_for :track do |track_fields|
= track_fields.hidden_field :user_id, value: current_user.id
= render 'tracks/fields', f: track_fields
.released-track__controls
= rt.destroy_field
= f.link_to_remove
.tracks__controls
= f.link_to_add 'Add Track'
%footer.form__actions.form__actions--right
= f.submit_button