If I have a list of items, how can I search some item in the list, by some criteria or something else? -- Posted via http://www.ruby-forum.com/.
What class is this list you are refering to? If it is a result set from a ActiveRecord find call try this: jobs = Job.find :all big_jobs = jobs.find{|job| job.total_sale > 100000 } Hope this helps, Zack On 8/5/06, N/a N/a <cain_152@yahoo.com> wrote:> If I have a list of items, how can I search some item in the list, by > some criteria or something else? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Zack Chandler wrote:> What class is this list you are refering to? If it is a result set > from a ActiveRecord find call try this: > > jobs = Job.find :all > big_jobs = jobs.find{|job| job.total_sale > 100000 } > > Hope this helps, > ZackWell, since it will be my first comercial app using rails, I will go slow, so i''ll keep it ActiveRecord. -- Posted via http://www.ruby-forum.com/.
Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part Url : http://wrath.rubyonrails.org/pipermail/rails/attachments/20060806/ecfd9e47/PGP-0001.bin
ins''it too ambitious to build a commercial app if you don''t even know how to find an item? On 8/5/06, N/a N/a <cain_152@yahoo.com> wrote:> > > > Well, since it will be my first comercial app using rails, I will go > slow, so i''ll keep it ActiveRecord. > > >______________ Heri R. http://sprinj.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060807/e466dadf/attachment.html
heri rakotomalala wrote:> ins''it too ambitious to build a commercial app if you don''t even know > how to > find an item?Yes I agree, but we will go slow, first build something that I can use internally at the office, like some kind of blog and/or wiki and then go for the top of the pyramid, when I have a solid ground. -- Posted via http://www.ruby-forum.com/.