I do an ajax to add the equipment. The models are not nested. On Wed, Jul 22, 2009 at 3:40 AM, Josh <joshbwh...@gmail.com> wrote:
> > I would say that in your case the easy way is to not nest the forms. > Just return in your post the list of equipments and the site. In your > controller, save or update the site, then try to save each equipment. > Make sure you reassign your instance variables properly. > > If you want to keep them nested and do this I would suggest submit the > site the first time 'add equipment' or whatever button is pressed and > reload the page or AJAX it up in the background. > > -Josh > > On Jul 21, 11:38 pm, erwin <yves_duf...@mac.com> wrote: > > You can use nested forms (site has_one or has_many 'equipment') > > > > http://railscasts.com/episodes/75-complex-forms-part-3 > > > > http://ryandaigle.com/articles/2009/2/1/what-s-new-in-edge-rails-nest... > > > > erwin > > > > On 21 juil, 02:42, Me <chabg...@gmail.com> wrote: > > > > > > > > > I have a model say "site" and another model "equipment". > > > > > In the Site form I can attach equipment dynamically in the form and > > > the equipment has attributes in the :through table. > > > > > Is there a way to validate the equipment attributes ONLY when the SITE > > > form has been completed? > > > --~--~---------~--~----~------------~-------~--~----~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---