Friday, October 30, 2009

[Rails] Re: nested_attributes and fields_for and ajax

These are good examples of using form_for/fields_for nested
attributes, which I have no problems with. It's integrating Ajax with
fields_for which is causing pain.

On Oct 30, 9:51 am, Pat Shaughnessy <p...@patshaughnessy.net> wrote:
> Hi... you might want to take a look at:http://github.com/alloy/complex-form-examples
>
> And:http://github.com/ryanb/complex-form-examples
>
> Both of these are interesting sample apps loaded with good coding
> ideas. I don't believe either of them uses AJAX or link_to_remote
> exactly the way you intended, but at least they might give you some
> new ideas and/or lead you in the right direction.
>
> - pathttp://patshaughnessy.net
>
> On Oct 29, 11:03 pm, mrmanishs <man...@acceleweb.com> wrote:
>
> > Hello there, I have a form_for and a fields_for within the form_for. I
> > want to add/delete item in the fields_for and refresh the items in the
> > fields_for list without having to regenerate the whole form.
>
> > Now, if I set up link_to_remotes for adding/deleting the item in
> > fields_for, it calls the controller, with the proper item to add/
> > delete, but what do I do to refresh the items in the fields_for after
> > the collection has been modified? Because the fields_for fields are
> > part of nested_attributes, how do I tell the view what the new
> > collection is to generate? Is there a way to convert a collection in a
> > controller to a fields_for collection, so the view can process it?
>
> > This has been frustrating to figure out...
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate