<%= form_with(model: [:admin, lesson]) do |form| %>
  <% if lesson.errors.any? %>
   <%= error_messages(lesson) %>
  <% end %>
  <%= form.hidden_field :week_id %>
  <div class="form-row">
    <div class="form-group col-md-6">
      <%= form.label :name %>
      <%= form.text_field :name, class: 'form-control' %>
    </div>

    <div class="form-group col-md-6">
      <%= form.label :description %>
      <%= form.text_area :description, class: 'form-control' %>
    </div>
  </div>
  <div class="form-row">
    <div class="form-group col-md-6">
      <%= form.label :video %>
      <%= f.select :video_id, options_for_select(Video.all.map{|s|[s.name, s.id]}) %>
    </div>

    <div class="form-group col-md-6">
      <%= form.label :informations %>
      <%= form.text_area :informations, class: 'form-control' %>
    </div>
  </div>
  <%= form.submit t('save'), class: 'btn btn-primary' %>
<% end %>
