You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.1 KiB

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
  1. <%= form_with(model: score, class: "contents") do |form| %>
  2. <% if score.errors.any? %>
  3. <div
  4. id="error_explanation"
  5. class="bg-red-50 text-red-500 px-3 py-2 font-medium rounded-lg mt-3"
  6. >
  7. <h2><%= pluralize(score.errors.count, "error") %>
  8. prohibited this score from being saved:</h2>
  9. <ul>
  10. <% score.errors.each do |error| %>
  11. <li><%= error.full_message %></li>
  12. <% end %>
  13. </ul>
  14. </div>
  15. <% end %>
  16. <div class="my-5">
  17. <%= form.label :name %>
  18. <%= form.text_field :name,
  19. class:
  20. "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %>
  21. </div>
  22. <div class="my-5">
  23. <%= form.label :grade %>
  24. <%= form.number_field :grade,
  25. class:
  26. "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %>
  27. </div>
  28. <div class="inline">
  29. <%= form.submit class:
  30. "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %>
  31. </div>
  32. <% end %>