Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • That did the trick, could you tell me why what i did is wrong, I was under the impression that symbols and strings could be used interchangeably and symbols had better performance. Commented Jun 27, 2012 at 17:52
  • 1
    Symbols and strings are different objects. Symbols are always a reference to the same object, whereas strings are new objects each time referenced (unless stored in a variable). Commented Jun 27, 2012 at 17:54
  • 1
    What @AndréSantosdeMedeiros said is correct. The behavior you are thinking of is something that comes with Rails, which provides a HashWithIndifferentAccess that lets you use either the symbol or string form of the key to access the value. Commented Jun 27, 2012 at 20:21