# \[need help\] what is the difference between :action =\> :index

**URL:** <https://www.ruby-forum.com/t/need-help-what-is-the-difference-between-action-index/87967>\
**Category:** Rails\
**Created:** [March 7, 2007, 8:16am UTC](https://www.ruby-forum.com/t/need-help-what-is-the-difference-between-action-index/87967 "2007-03-07T08:16:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bill](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ac91a4/32.png) [@bill](https://www.ruby-forum.com/u/bill)\
**Post date:** [March 7, 2007, 8:16am UTC](https://www.ruby-forum.com/t/need-help-what-is-the-difference-between-action-index/87967/1 "2007-03-07T08:16:24Z")

</div>

i have read lots of resources about ruby symbol, but i’m still very  
confused about it!  
when i write a rails project, i can not distinguish the difference  
like the subject above and in fact it seems the same when browsing  
through two different computers , why?

---

<div class="post-metadata">

**Author:** ![bill](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ac91a4/32.png) [@bill](https://www.ruby-forum.com/u/bill)\
**Post date:** [March 7, 2007, 9:00am UTC](https://www.ruby-forum.com/t/need-help-what-is-the-difference-between-action-index/87967/2 "2007-03-07T09:00:28Z")

</div>

> when i write a rails project, i can not distinguish the difference  
> like the subject above and in fact it seems the same when browsing  
> through two different computers , why?  
> Although :index and “index” are two very different things, Rails  
> implements something called HashWithIndifferentAccess that means you  
> can get away with using either.

It’s better to use :symbols than “strings” where you can, because a  
symbol is stored only once in memory, whereas a string requires an  
extra copy each time you refer to it.

There’s an excellent explanation at  
[http://glu.ttono.us/articles/2005/08/19/understanding-ruby-symbols](http://glu.ttono.us/articles/2005/08/19/understanding-ruby-symbols)  
.

Gwyn.

---

<div class="post-metadata">

**Author:** ![bill](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ac91a4/32.png) [@bill](https://www.ruby-forum.com/u/bill)\
**Post date:** [March 7, 2007, 10:48am UTC](https://www.ruby-forum.com/t/need-help-what-is-the-difference-between-action-index/87967/3 "2007-03-07T10:48:46Z")

</div>

On 3ÔÂ7ÈÕ, ÏÂÎç3Ê±58·Ö, “Gwyn Morfey” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> extra copy each time you refer to it.
> 
> There’s an excellent explanation athttp://glu.ttono.us/articles/2005/08/19/understanding-ruby-symbols  
> .
> 
> Gwyn.

Thank you!
