Ruby on Rails- :symbols, @iVars and "strings" - oh my!
Posted
by Meltemi
on Stack Overflow
See other posts from Stack Overflow
or by Meltemi
Published on 2010-06-08T17:51:42Z
Indexed on
2010/06/08
20:02 UTC
Read the original article
Hit count: 225
New to Rails and trying to get my head around when/why to use :symbols
, @ivars
, "strings"
within the framework.
I think I understand the differences between them conceptually
- only one
:symbol
instance per project - one
@ivar
per instance - multiple
"strings"
- as they are created whenever referenced (?)
Feel free to correct me!
The main confusion comes from understanding the rules & conventions of what Rails expects - where and WHY?
I'm sure there's an "Ah ha!" moment coming but I haven't had it yet...as it seems pretty arbitrary to me (coming from C/Obj-C).
-thx
© Stack Overflow or respective owner