Sha256: 57731b3c9d64b4715f9e9f7f59cf517f6ccbeae9c8e3cf3b569e9c0376736821

Contents?: true

Size: 281 Bytes

Versions: 1

Compression:

Stored size: 281 Bytes

Contents

class Post < ActiveRecord::Base
  validates :title, presence: true, length: {within: 20..50}, numericality: {greater_than_or_equal_to: 20}
  validates :title, format: { with: /\A[a-zA-Z]+\z/, message: "only allows letters" }
  validates :intro, presence: true, if: :published?
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bootstrap_validator_rails-0.4.2 test/dummy/app/models/post.rb