# Nested attrivutes ; :reject\_if (Rails 2.3.4)

**URL:** <https://www.ruby-forum.com/t/nested-attrivutes-reject-if-rails-2-3-4/183943>\
**Category:** Rails\
**Created:** [February 22, 2010, 9:34pm UTC](https://www.ruby-forum.com/t/nested-attrivutes-reject-if-rails-2-3-4/183943 "2010-02-22T21:34:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hagbard.celine](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/958977/32.png) [@hagbard.celine](https://www.ruby-forum.com/u/hagbard.celine)\
**Post date:** [February 22, 2010, 9:34pm UTC](https://www.ruby-forum.com/t/nested-attrivutes-reject-if-rails-2-3-4/183943/1 "2010-02-22T21:34:49Z")

</div>

Hi There!

I got a strange behavior while playin’ with nested attributes.I want  
to reject a creation if e.g. “attr” is blank, through a model (one-to-  
many)

I tried this code with no success.  
:reject\_if =\> proc { |a| a[:attr].blank? } (symbol hash key)

This code runs correctly.  
:reject\_if =\> proc { |a| a[‘attr’].blank? } (string hash key)

I thought this is the same? I saw many example with an symbol hash…

Thanks a lot…

Cheers  
hagbard
