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


#1

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?


#2

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
.

Gwyn.


#3

On 3ÔÂ7ÈÕ, ÏÂÎç3ʱ58·Ö, “Gwyn Morfey” 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!