0

I am new to ruby. So I was trying to get data from my data array but I get a "can't convert String into Integer" error.

The way I am accessing data is

data["myobject"]
1
  • Please provide code and explain what you're trying to achieve. Commented Oct 1, 2014 at 8:53

1 Answer 1

2

It seem that data is an array, not a hash.

I think data looks like this :

data=['foo', 'bar']

instead of looking like this :

data={'myObject'=>'foo', 'myObject2'=>'bar'}

So try to change data or retrieve data by its index

data[0]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.