Skip to content

Commit

Permalink
validate 500 max for contacts
Browse files Browse the repository at this point in the history
  • Loading branch information
kasugaijin committed Dec 19, 2024
1 parent 192943b commit 8cf99dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/contact.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ class Contact
include ActiveModel::Model
attr_accessor :name, :email, :message

validates :name, :email, :message, presence: true
validates :name, :email, presence: true
validates :message, presence: true, length: {maximum: 500}

# credit: https://medium.com/@limichelle21/building-and-debugging-a-contact-form-with-rails-mailgun-heroku-c0185b8bf419
end

0 comments on commit 8cf99dd

Please sign in to comment.