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.8 KiB

5 months ago
  1. <div>
  2. <h1 class="font-bold text-4xl">Form with strong parameters</h1>
  3. <%= form_with url: update_strong_path, class:"bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4" do |form| %>
  4. <div class="mb-4">
  5. <%= form.label :name, "Name:", class:"block text-gray-700 text-sm font-bold mb-2" %>
  6. </div>
  7. <div class="mb-6">
  8. <%= form.text_field 'strong[name]', class:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" %>
  9. </div>
  10. <div class="mb-4">
  11. <%= form.label :surname, "Surname:", class:"block text-gray-700 text-sm font-bold mb-2" %>
  12. </div>
  13. <div class="mb-6">
  14. <%= form.text_field 'strong[surname]', class:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" %>
  15. </div>
  16. <div class="flex flex-wrap -mx-3 mb-6">
  17. <div class="w-full md:w-1/2 px-3 mb-6 md:mb-0">
  18. <%= form.label :birth_date, "Birth Date:", class:"block text-gray-700 text-sm font-bold mb-2" %>
  19. <%= form.text_field 'strong[birth][date]', class:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" %>
  20. </div>
  21. <div class="w-full md:w-1/2 px-3">
  22. <%= form.label :birth_location, "Birth Location:", class:"block text-gray-700 text-sm font-bold mb-2" %>
  23. <%= form.text_field 'strong[birth][location]', class:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" %>
  24. </div>
  25. </div>
  26. <div class="flex items-center justify-between">
  27. <%= form.submit class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline" %>
  28. </div>
  29. <% end %>
  30. </div>