Guest User

Untitled

a guest
Aug 2nd, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. displaying error messages with haml
  2. = form_for @talent do |f|
  3.  
  4. - if @talent.errors.any?
  5. #error_explanation
  6. %h2= pluralize(@talent.errors.count, "error")
  7. "prohibited this user from being saved:"
  8. %ul - @talent.errors.full_messages.each do |msg|
  9. %li= msg
  10.  
  11. = f.label :First_Name
  12. = f.text_field :first_name
  13. = f.label :Last_Name
  14. = f.text_field :last_name
  15. = f.label :City
  16. = f.text_field :city
  17. = f.label :State
  18. = f.text_field :state
  19. = f.label :Zip_code
  20. = f.text_field :zip_code
  21. = f.label :Email
  22. = f.text_field :email
  23. = f.submit "Create"
  24.  
  25. Illegal nesting: nesting within plain text is illegal.
  26.  
  27. Extracted source (around line #7):
  28.  
  29. 4: #error_explanation
  30. 5: %h2= pluralize(@talent.errors.count, "error")
  31. 6: "prohibited this user from being saved:"
  32. 7: %ul - @talent.errors.full_messages.each do |msg|
  33. 8: %li= msg
  34. 9:
  35. 10: = f.label :First_Name
  36.  
  37. - if @talent.errors.any?
  38. #error_explanation
  39. %h2= pluralize(@talent.errors.count, "error")
  40. "prohibited this user from being saved:"
  41. %ul
  42. - @talent.errors.full_messages.each do |msg|
  43. %li= msg
  44.  
  45. - if @talent.errors.any?
  46. #error_explanation
  47. %h2
  48. = pluralize(@talent.errors.count, "error")
  49. "prohibited this user from being saved:"
  50. %ul
  51. - @talent.errors.full_messages.each do |msg|
  52. %li= msg
  53.  
  54. = form_for @talent do |f|
  55.  
  56. - if @talent.errors.any?
  57. #error_explanation
  58. %h2
  59. = pluralize(@talent.errors.count, "error")
  60. "prohibited this user from being saved:"
  61. %ul - @talent.errors.full_messages.each do |msg|
  62. %li= msg
  63.  
  64. #error_explanation
  65. %h2= pluralize(@talent.errors.count, "error")
  66. "prohibited this user from being saved:"
  67. %ul - @talent.errors.full_messages.each do |msg|
  68. %li= msg
Add Comment
Please, Sign In to add comment