0
를 만들 내보기잘못된 번호는 내가이 오류가
<%= @contact.errors.full_message.each do |message| %>
에서이 라인은 contact_contr의 방법을 만들어 내 oller는 인수에게
contact_controller.rb
def index
@contact = Contact.all
end
def create
@contact = Contact.new(contact_params)
if @contact.save
flash[:notice] = "Welcome"
redirect_to "/"
else
flash[:alert] = "You filled wrong the form"
render 'connection'
end
end
을 수행하지 않고 난 내 모델에서 해당 메시지가 표시되어있어
contact.rb
validates :firstname, presence: true, length: { maximum: 30, minimum:2,
too_long: "30 characters is the maximum allowed.", too_short: "2 characters is the minimum allowed." }
validates :lastname, presence: true, length: { maximum: 50, minimum:2,
too_long: "50 characters is the maximum allowed.", too_short: "2 characters is the minimum allowed." }
VALID_EMAIL_REGEX = /\A[\w+\-.][email protected][a-z\d\-.]+\.[a-z]+\z/i
validates :email, presence: true, uniqueness: {message: "Email is already subscribed"}, length: { maximum: 40, minimum:7,
too_long: "40 characters is the maximum allowed.", too_short: "7 characters is the minimum allowed.",},
format: { with: VALID_EMAIL_REGEX }
validates :password, presence: true, length: { maximum: 30, minimum:6,
too_long: "30 characters is the maximum allowed.", too_short: "6 characters is the minimum allowed." }
내가 할 루비가 원하는 인수를 이해하지 못합니다. 누구는 그것이 무엇인지 압니까? 당신은 full_messages
을 사용한다
오히려'full_message'입니다 'full_messages'보다는 오타가 있습니까? 실제로'full_message'를 원하지 않는다고 가정합니다. –