From 3f97f056f9707101a14d0ff43db0866ddc7515c2 Mon Sep 17 00:00:00 2001 From: Rodrigo Navarro Date: Sun, 27 Feb 2011 10:03:50 -0800 Subject: Pointing out that dynamic_form plugin must be installed to be able to use error_messages and error_messages_for view helpers. --- .../source/active_record_validations_callbacks.textile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'railties/guides') diff --git a/railties/guides/source/active_record_validations_callbacks.textile b/railties/guides/source/active_record_validations_callbacks.textile index 5dc6ef3774..58a184a48e 100644 --- a/railties/guides/source/active_record_validations_callbacks.textile +++ b/railties/guides/source/active_record_validations_callbacks.textile @@ -738,7 +738,20 @@ person.errors.size # => 0 h3. Displaying Validation Errors in the View -Rails provides built-in helpers to display the error messages of your models in your view templates. +Rails maintains an official plugin that provides helpers to display the error messages of your models in your view templates. You can install it as a plugin or as a Gem. + +h4. Installing as a plugin + +$ rails plugin install git://github.com/rails/dynamic_form.git + + +h4 Installing as a Gem +Add this line on your Gemfile: + +gem "dynamic_form" + + +Now you will have access to these two methods in your view templates: h4. +error_messages+ and +error_messages_for+ -- cgit v1.2.3