Forum: Ruby Insert a value into ruby arrays

Ecec81af7caddc8730eee285475df4da?d=identicon&s=25 ruby rails (rubyonrails)
on 2013-09-08 07:36
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"
5a837592409354297424994e8d62f722?d=identicon&s=25 Ryan Davis (Guest)
on 2013-09-08 07:50
(Received via mailing list)
On Sep 7, 2013, at 22:36 , ruby rails <lists@ruby-forum.com> 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?
4f26b34a72729f9543ba84c398dba2c2?d=identicon&s=25 D. Deryl Downey (ddd)
on 2013-09-08 07:55
(Received via mailing list)
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.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.