RoR: Output Hash, getting correct parameters?
- by andrewliu
I have output something like this:
#<Hashie::Mash created_time="1366008641"
from=#<Hashie::Mash full_name="Cor Valen" id="22340" username="_corin">
id="4344344286" text="Look Who It Is, My Brother, My Favorite Deputy">
This was an output if I did this:
<%= media.caption %>
I wanted to get the text part, and I did this:
<%= media.caption.text %>
gets me error: undefined method `text' for nil:NilClass
<%= media.caption[:text] %>
gets me error: undefined method `[]' for nil:NilClass
I don't get it?
Thanks