Forum: Rails-ES Nested forms.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
39086eb3d9a1437276d07c08ea0c3821?d=identicon&s=25 Guillermo Álvarez Fernández (Guest)
on 2009-02-01 05:09
(Received via mailing list)
Pasaba yo por github, cuando de repente... zas. Alegrón.

> http://github.com/rails/rails/commit/ec8f04584479a...
> Add support for nested object forms to ActiveRecord and the helpers
> in ActionPack

Todo el rollo ese del comit para al finar resumirse en esto.

> class Person < ActiveRecord::Base
>   has_many :projects
>   accepts_nested_attributes_for :projects, :allow_destroy => true
> end

> <% form_for @person, :url => { :action => "update" } do |
> person_form| %>
>   ...
>   <% person_form.fields_for :projects do |project_fields| %>
>     Delete: <%= project_fields.check_box :_delete %>
>   <% end %>
> <% end %>

Solo decir que...

Por fin.

---
Guillermo Álvarez Fernández
guillermo@cientifico.net
http://cientifico.net
6f952bee7570a3db2ecba5b06c0062b3?d=identicon&s=25 Fernando Guillen (fguillen)
on 2009-02-01 05:53
(Received via mailing list)
2009/2/1 Guillermo Álvarez Fernández <guillermo@cientifico.net>:
>>  accepts_nested_attributes_for :projects, :allow_destroy => true
>> end
>
>> <% form_for @person, :url => { :action => "update" } do |person_form| %>
>>  ...
>>  <% person_form.fields_for :projects do |project_fields| %>
>>    Delete: <%= project_fields.check_box :_delete %>
>>  <% end %>
>> <% end %>
>

Me imagino que te refieres a esto:
http://weblog.rubyonrails.com/2009/1/26/nested-model-forms

Creo que el Ryan algo ha hecho por ahí.. tiene unos screencasts que
intenta resolver este asunto antes del parche:
http://railscasts.com/episodes/73-complex-forms-part-1
http://railscasts.com/episodes/74-complex-forms-part-2
http://railscasts.com/episodes/75-complex-forms-part-3


> Solo decir que...
>
> Por fin.
>

Sipi
02d2caa0eca64f3e01686db06c2b5b3e?d=identicon&s=25 javier barcena (Guest)
on 2009-02-01 17:49
(Received via mailing list)
que mas que sumarme a ese ...POR FIN! la verdad que esta funcionalidad
nos
hizo hacer diversas soluciones mientras no existia este plug. Por fin !!

saludos.!
2009/2/1 Fernando Guillen <fguillen.mail@gmail.com>
This topic is locked and can not be replied to.