_form.html.erb 573 B

1234567891011121314151617
  1. <%= bootstrap_form_for(@assignment) do |f| %>
  2. <%= render 'shared/error_messages', object: f.object %>
  3. <% unless action_name == 'create' %>
  4. <%= f.select :course_id, options_for_select(current_user.courses.merge(CourseParticipation.teachers).map{ |course| [course.name, course.id] }) %>
  5. <% else %>
  6. <%= f.text_field :course, value: @assignment.course.name, disabled: true %>
  7. <% end %>
  8. <%= f.text_field :name %>
  9. <%= f.datetime_field :due_at %>
  10. <%= f.text_area :description %>
  11. <%= f.submit yield(:button_text), class: "btn btn-primary" %>
  12. <% end %>