On 18 March 2010 06:18, Me <chabg...@gmail.com> wrote:
> I assign an array to a hash value.
>
> h[:ext_array]  it is nil.

I copied your hash into IRB and it worked fine:
>> h = {:has_key=>0, :ext_array=>["Text file (.txt)<br/>", "Rich Text Format
(.rtf)<br/>", "Word Document (.doc, .docx)<br/>"]}
=> {:has_key=>0, :ext_array=>["Text file (.txt)<br/>", "Rich Text
Format\n(.rtf)<br/>", "Word Document (.doc, .docx)<br/>"]}
>> h[:ext_array]
=> ["Text file (.txt)<br/>", "Rich Text Format\n(.rtf)<br/>", "Word
Document (.doc, .docx)<br/>"]
>>

Can you post the code where you're accessing h[:ext_array] and getting
nil. I think you might be getting nil as the result of an expression
rather than the value from the hash.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to