# A newbie question about setting value for {{var}}

**URL:** <https://www.ruby-forum.com/t/a-newbie-question-about-setting-value-for-var/156457>\
**Category:** Rails\
**Created:** [December 28, 2008, 3:47am UTC](https://www.ruby-forum.com/t/a-newbie-question-about-setting-value-for-var/156457 "2008-12-28T03:47:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ratcheer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/aca169/32.png) [@ratcheer](https://www.ruby-forum.com/u/ratcheer)\
**Post date:** [December 28, 2008, 3:47am UTC](https://www.ruby-forum.com/t/a-newbie-question-about-setting-value-for-var/156457/1 "2008-12-28T03:47:03Z")

</div>

I study RailSpace code and the line code in the book

@error\_messages = ActiveRecord::Errors.default\_error\_messages

has been deprecated. Instead the following is recommended

@error\_messages = I18n.translate(‘activerecord.errors.messages’)

But the line  
correct\_error\_message = sprintf(@error\_messages[:too\_short],  
:count=\>min\_length)

does not assign the value min\_length to {{count}} part of  
@error\_messages[:too\_short] “is too short (minimum is {{count}}  
characters)” .

I do not know how to set the min\_length value to {{count}} in  
error\_messages[:too\_short].

Thanks.

Tim
