Add New Student

<%= form_with model: [@classroom, @student], local: true, class: "space-y-6" do |f| %> <% if @student.errors.any? %> <% end %>
<%= f.label :username, class: "block text-sm font-medium text-gray-700" %> <%= f.text_field :username, class: "mt-1 block w-full shadow-xs sm:text-sm border-gray-300 rounded-md", required: true, placeholder: "e.g., john_doe" %>

A password will be automatically generated for the student.

<%= f.submit "Create Student", class: "inline-flex justify-center py-2 px-4 border border-transparent shadow-xs text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" %> <%= link_to "Cancel", classroom_path(@classroom), class: "ml-3 inline-flex justify-center py-2 px-4 border border-gray-300 shadow-xs text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-hidden focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" %>
<% end %>