# Can I now use a symbol to access the assigns hash?

**URL:** <https://www.ruby-forum.com/t/can-i-now-use-a-symbol-to-access-the-assigns-hash/147562>\
**Category:** Rails\
**Created:** [September 3, 2008, 6:12am UTC](https://www.ruby-forum.com/t/can-i-now-use-a-symbol-to-access-the-assigns-hash/147562 "2008-09-03T06:12:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubyfreak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9c0ed/32.png) [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Post date:** [September 3, 2008, 6:12am UTC](https://www.ruby-forum.com/t/can-i-now-use-a-symbol-to-access-the-assigns-hash/147562/1 "2008-09-03T06:12:59Z")

</div>

I am reading an ancient(but good) tutorial on Test::Unit  
It states that you can not use a symbol to access items in the assigns  
hash and must use a string identifier. I would think that would have  
been fixed at this point.

[http://manuals.rubyonrails.com/read/chapter/28](http://manuals.rubyonrails.com/read/chapter/28)

Thanks in advance

---

<div class="post-metadata">

**Author:** ![rubyfreak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9c0ed/32.png) [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Post date:** [September 3, 2008, 8:31am UTC](https://www.ruby-forum.com/t/can-i-now-use-a-symbol-to-access-the-assigns-hash/147562/2 "2008-09-03T08:31:37Z")

</div>

On 3 Sep 2008, at 06:12, Ruby F. wrote:

> I am reading an ancient(but good) tutorial on Test::Unit  
> It states that you can not use a symbol to access items in the assigns  
> hash and must use a string identifier. I would think that would have  
> been fixed at this point.
> 
> [Peak Obsession](http://manuals.rubyonrails.com/read/chapter/28)

Should be a pretty easy experiment to verify this. Personally I  
wouldn’t consider this a bug. Strings and symbols are generally not  
interchangeable (only the params hash maintains that illusion - see  
[http://blog.hasmanythrough.com/2008/4/19/symbols-are-not-pretty-strings](http://blog.hasmanythrough.com/2008/4/19/symbols-are-not-pretty-strings)  
for some of the reasons behind this)

Fred
