<% institution = @institution || student.institution %> <% form_url = student.persisted? ? institution_student_path(institution, student) : institution_students_path(institution) %> <%= form_with(model: student, url: form_url, remote: true) do |form| %> <% if student.errors.any? %>

<%= pluralize(student.errors.count, "error") %> prohibited this student from being saved:

<% end %>
<%= form.label :first_name, style: "display: block" %> <%= form.text_field :first_name %>
<%= form.label :last_name, style: "display: block" %> <%= form.text_field :last_name %>
<%= form.label :email, style: "display: block" %> <%= form.text_field :email %>
<%= form.label :phone_number, style: "display: block" %> <%= form.text_field :phone_number %>
<%= form.label :place, style: "display: block" %> <%= form.text_field :place %>
<%= form.label :age, style: "display: block" %> <%= form.number_field :age %>
<%= form.label :photo, "Upload Photo", style: "display: block" %> <%= form.file_field :photo, accept: "image/*" %>
<%= form.submit %>
<% end %>