Forum: Ruby on Rails [need help] what is the difference between :action => :index

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
67a93ab6626309013c5e0d57b150a6fd?d=identicon&s=25 Bill (Guest)
on 2007-03-07 08:16
(Received via mailing list)
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?
A6030ddd9d3caaa00dd6c2047ecb3a89?d=identicon&s=25 Gwyn Morfey (Guest)
on 2007-03-07 09:00
(Received via mailing list)
> 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/understand...
.

Gwyn.
67a93ab6626309013c5e0d57b150a6fd?d=identicon&s=25 Bill (Guest)
on 2007-03-07 10:48
(Received via mailing list)
On 3ÔÂ7ÈÕ, ÏÂÎç3ʱ58·Ö, "Gwyn Morfey" <dezyne....@googlemail.com> wrote:
> extra copy each time you refer to it.
>
> There's an excellent explanation 
athttp://glu.ttono.us/articles/2005/08/19/understand...
> .
>
> Gwyn.

Thank you!
This topic is locked and can not be replied to.