aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/active_record_validations_callbacks.md
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikachu.com>2012-09-01 19:34:21 -0400
committerPrem Sichanugrist <s@sikac.hu>2012-09-17 15:54:22 -0400
commitc89c163a0e7df7b29ba33608742eaba09a058090 (patch)
tree446ff2dea30ba938426f7f2759a1facd9b085429 /guides/source/active_record_validations_callbacks.md
parent872b7af337196febc516cb6218ae3d07f01a11a8 (diff)
downloadrails-c89c163a0e7df7b29ba33608742eaba09a058090.tar.gz
rails-c89c163a0e7df7b29ba33608742eaba09a058090.tar.bz2
rails-c89c163a0e7df7b29ba33608742eaba09a058090.zip
Convert inline code tags to Markdown
Diffstat (limited to 'guides/source/active_record_validations_callbacks.md')
-rw-r--r--guides/source/active_record_validations_callbacks.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/guides/source/active_record_validations_callbacks.md b/guides/source/active_record_validations_callbacks.md
index c8a0e535e0..0f5a6f169a 100644
--- a/guides/source/active_record_validations_callbacks.md
+++ b/guides/source/active_record_validations_callbacks.md
@@ -299,7 +299,7 @@ The possible length constraint options are:
* +:in+ (or +:within+) - The attribute length must be included in a given interval. The value for this option must be a range.
* +:is+ - The attribute length must be equal to the given value.
-The default error messages depend on the type of length validation being performed. You can personalize these messages using the +:wrong_length+, +:too_long+, and +:too_short+ options and <tt>%{count}</tt> as a placeholder for the number corresponding to the length constraint being used. You can still use the +:message+ option to specify an error message.
+The default error messages depend on the type of length validation being performed. You can personalize these messages using the +:wrong_length+, +:too_long+, and +:too_short+ options and `%{count}` as a placeholder for the number corresponding to the length constraint being used. You can still use the +:message+ option to specify an error message.
```ruby
class Person < ActiveRecord::Base
@@ -380,7 +380,7 @@ end
If you validate the presence of an object associated via a +has_one+ or +has_many+ relationship, it will check that the object is neither +blank?+ nor +marked_for_destruction?+.
-Since +false.blank?+ is true, if you want to validate the presence of a boolean field you should use <tt>validates :field_name, :inclusion => { :in => [true, false] }</tt>.
+Since +false.blank?+ is true, if you want to validate the presence of a boolean field you should use `validates :field_name, :inclusion => { :in => [true, false] }`.
The default error message is "_can't be empty_".
@@ -624,7 +624,7 @@ When the built-in validation helpers are not enough for your needs, you can writ
### Custom Validators
-Custom validators are classes that extend <tt>ActiveModel::Validator</tt>. These classes must implement a +validate+ method which takes a record as an argument and performs the validation on it. The custom validator is called using the +validates_with+ method.
+Custom validators are classes that extend `ActiveModel::Validator`. These classes must implement a +validate+ method which takes a record as an argument and performs the validation on it. The custom validator is called using the +validates_with+ method.
```ruby
class MyValidator < ActiveModel::Validator
@@ -641,7 +641,7 @@ class Person
end
```
-The easiest way to add custom validators for validating individual attributes is with the convenient <tt>ActiveModel::EachValidator</tt>. In this case, the custom validator class must implement a +validate_each+ method which takes three arguments: record, attribute and value which correspond to the instance, the attribute to be validated and the value of the attribute in the passed instance.
+The easiest way to add custom validators for validating individual attributes is with the convenient `ActiveModel::EachValidator`. In this case, the custom validator class must implement a +validate_each+ method which takes three arguments: record, attribute and value which correspond to the instance, the attribute to be validated and the value of the attribute in the passed instance.
```ruby
class EmailValidator < ActiveModel::EachValidator