Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
validation
class Code < ActiveRecord::Base
validates :limit,
allow_blank: true,
format: { with: /\A(\d{4})-(\d{1,2})-(\d{1,2})\z/, message: "は2015-01-01の形式で入力してください" }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment