On Miércoles, 16 de Febrero de 2011 04:14:24 denysonique escribió: > Hi, > > I have the following database schema: > > > > create_table "addresses", :force => true do |t| > t.string "road" > t.string "city" > t.datetime "created_at" > t.datetime "updated_at" > t.integer "client_id" > end > > create_table "clients", :force => true do |t| > t.integer "address_id" > t.integer "order_id" > t.string "first_name" > t.string "last_name" > t.datetime "created_at" > t.datetime "updated_at" > end > > create_table "orders", :force => true do |t| > t.integer "order_id" > t.integer "client_id" > t.datetime "created_at" > t.datetime "updated_at" > end > end > > > > and models: > > > class Client < ActiveRecord::Base > belongs_to :address > end > > class Order < ActiveRecord::Base > belongs_to :client > end > > class Address < ActiveRecord::Base > end > > > > The intention of this setup is to have records of many Clients, each > Client has an address. Multiple clients can have the same address. The > client_id in the addresses table is used for this purpose. > > When I visit the /Clients ActiveScaffold view, and click create I am > able to enter data for the new client, including the data of the new > address for the client. > > But, when I visit the /Orders view and click create, I can add a new > Client and enter the data for him, but for the address there is only a > select box, which only can be used to select an existing address, > there are no fields to create a new address for the new client. > How can I include the address fields for the new client, in order to > create a new address for the client?
Sorry, ActiveScaffold doesn't support multi-level subform. Some people has implemented it, but it's not supported by ActiveScaffold out of the box. Look at in this group for cascade subforms. > > I also posted this to StackOverflow: > http://stackoverflow.com/questions/5012149/activescaffold-when-inserting-a- > new-record-how-to-enable-entry-fields-for-a-co > > Thanks in advance, > Dennis -- Sergio Cambra .:: entreCables S.L. ::. Mariana Pineda 23, 50.018 Zaragoza T) 902 021 404 F) 976 52 98 07 E) [email protected] -- You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en.
