Insert a value into ruby arrays

HI,

I have a @projects array and I have multiple attributes in that…
(id,proj_name,desc etc). I need to loop @projects array and insert one
more attribute(“Multiple”) to each project…So array[0] will be projects
object and array[1] will be of value “Multiple”

On Sep 7, 2013, at 22:36 , ruby rails [email protected] wrote:

I have a @projects array and I have multiple attributes in that…
(id,proj_name,desc etc). I need to loop @projects array and insert one
more attribute(“Multiple”) to each project…So array[0] will be projects
object and array[1] will be of value “Multiple”

Is there a question or request hidden somewhere in here or are you
hoping someone writes all this code for you?

How about reading ‘ri Array’ and paying attention to the available
methods.
You already know how to write a loop for the rest of it.

We’re not going to write your code for you. You’ve been on this list
long
enough to know.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs