_form.html.erb 481 B

123456789
  1. <%= bootstrap_form_for(@course.course_participations.build, html: { class: "form-inline" }) do |f| %>
  2. <%= render 'shared/error_messages', object: f.object %>
  3. <%= f.hidden_field :course_id, value: @course.id %>
  4. <%= f.select :role, collection: CourseParticipation.roles.keys.to_a %>
  5. <%= f.select :user_id, options_for_select(User.where.not(id: @course.users.map(&:id)).map{ |user| [user.name, user.id] }) %>
  6. <%= f.submit "Add user", class: "btn btn-primary" %>
  7. <% end %>