class Person < ApplicationRecord validates :name, presence: true end ... Model-level validations are the best way to ensure that only valid data is saved ...
確定! 回上一頁