A Symbol looks like a variable name but it's prefixed with a colon.
Examples - :action
Alternatively, you can consider the colon to mean "thing named" so :id is "the thing named id." You can also think of :id as meaning the name of the variable id, and plain id as meaning the value of the variable.
A Symbol is the most basic Ruby object you can create. It's just a name. Symbols are useful because a given symbol name refers to the same object throughout a Ruby program. Symbols are...
- Tags: Ruby basics|