Forum: Ruby Insert a value into ruby arrays

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
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.
This topic is locked and can not be replied to.