From: Roelof Wobben Date: 2012-10-14T00:10:23+09:00 Subject: Re: multiple array problem --_63431350-c0e7-4a37-ac1c-a47ef54ee483_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable You mean a array which contains the array. That I have but as I said I need one category a time. Roelof > Date: Sat=2C 13 Oct 2012 21:54:32 +0900 > From: lists@ruby-forum.com > Subject: Re: multiple array problem > To: ruby-talk@ruby-lang.org >=20 > Hi=2C >=20 > first select the right category and iterate over the articles=20 > afterwards. >=20 > For example: >=20 > cat_id =3D 2 > category =3D > case cat_id > when 1 > category1 > when 2 > category2 > else > category3 > end > category.article.each {|art| puts art.name} >=20 > It would actually be better if you'd store the different category=20 > objects in a structured way (like in a array). That would make selecting= =20 > them much easier. >=20 > --=20 > Posted via http://www.ruby-forum.com/. >=20 = --_63431350-c0e7-4a37-ac1c-a47ef54ee483_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
You mean a array =3B which contains the array.
That I have but as I = said I need one category a time.

Roelof


>=3B Date: Sat=2C 13 Oct 2012 21:54:32 +0900>=3B From: lists@ruby-forum.com
>=3B Subject: Re: multiple array pr= oblem
>=3B To: ruby-talk@ruby-lang.org
>=3B
>=3B Hi=2C
&= gt=3B
>=3B first select the right category and iterate over the artic= les
>=3B afterwards.
>=3B
>=3B For example:
>=3B
= >=3B cat_id =3D 2
>=3B category =3D
>=3B case cat_id
>= =3B when 1
>=3B category1
>=3B when 2
>=3B categ= ory2
>=3B else
>=3B category3
>=3B end
>=3B cat= egory.article.each {|art| puts art.name}
>=3B
>=3B It would actu= ally be better if you'd store the different category
>=3B objects in = a structured way (like in a array). That would make selecting
>=3B th= em much easier.
>=3B
>=3B --
>=3B Posted via http://www.ru= by-forum.com/.
>=3B
= --_63431350-c0e7-4a37-ac1c-a47ef54ee483_--