From: Rick DeNatale Date: 2008-01-31T06:56:39+09:00 Subject: Re: storing multiple of the same object from a request On 1/30/08, laredotornado wrote: > Hi, > > I have this form ... > > <% for i in 1 .. 5 %> > > > > > > > > > > >
<%= text_field("ec_line_item", "prescription_number", > "index" => i) %><%= text_field("ec_line_item", "description", "index" > => i) %>
Prescription NumberDescription
> > <% end %> > > Now on my controller end I would like to save the objects (each object > is of class "ec_line_item" with attributes "prescription_number" and > "description") but only if the prescription_number attribute is not > empty. What's the most efficient way of doing this? First, this is really a question for the rails group. http://groups.google.com/group/rubyonrails-talk/topics That said, you should check out Ryan Bates series of 3 RailsCasts starting with: http://railscasts.com/episodes/73 -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/