%= form_with(model: todo) do |form| %>
<% if todo.errors.any? %>
<%= pluralize(todo.errors.count, "error") %> prohibited this todo from being saved:
<% todo.errors.each do |error| %>
- <%= error.full_message %>
<% end %>
<% end %>
<%= form.label :name, style: "display: block" %>
<%= form.text_field :name %>
<%= form.label :description, style: "display: block" %>
<%= form.textarea :description %>
<%= form.label :completed %>
<%= form.check_box :completed %>
<%= form.label :priority %>
<%= form.number_field :priority %>
<%= form.label :project_id %>
<%= form.collection_select :project_id, Project.all, :id, :name, prompt: "Select a project" %>
<%= form.submit %>
<% end %>