Rails newb syntax question

Posted by Veep on Stack Overflow See other posts from Stack Overflow or by Veep
Published on 2010-06-08T18:41:18Z Indexed on 2010/06/08 18:52 UTC
Read the original article Hit count: 267

Filed under:
|
|

I'm in the console, looking at someone else's app. I come across the following:

>> p.location
=> [#<Tag id: 2, name: "projects">]

Why do I see this result, which seems to be the object name, and how do I access the actual attribute name, "projects"?

>> p.location.name
=> "Tag"

Thank you very much!

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby