Ruby on Rails Monday, August 1, 2011

On Aug 1, 2011, at 9:05 AM, Chris Kottom wrote:

> Well then you need to go with an alternative that allows the user to
> add rows to the form using some dynamic HTML. I'd get it working
> with a static version as I've suggested first and then try to adapt
> it to this requirement.
>
> On Mon, Aug 1, 2011 at 1:43 PM, Mauro <mrsanna1@gmail.com> wrote:
> On 1 August 2011 13:35, Chris Kottom <chris@chriskottom.com> wrote:
> > No reason. It can be whatever number of times you decide. If you
> want to
> > show the user a form with 10 delivery items, then it would be
> 10.times.
>
> That's difficult because is the user that decide how much products
> deliver and then how much delivery_items contains a delivery.

Work through the Railscast on accepts_nested_attributes (Complex Forms
or something like that, don't recall the title exactly -- it's a two-
parter) because Ryan covers this case exactly. And he follows the same
path of "make it work as a static form first" that you should try to
follow as a rule whenever making Ajax form magick happen.

Walter

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment