Hello Sergio,

just to avoid confusion, here are some screenshots to show what I'm interested in. When creating a new Cage (not nested), the custom layout looks like http://imageupload.org/?di=7129685211816

The log when clicking '"Create New" Litter' is:

Processing LittersController#new (for x at 2011-02-04 21:40:13) [GET]
Parameters: {"eid"=>"5cc47093cc38d2655051963d4c6ecf6e", "parent_column"=>"litters", "nested"=>"true", "action"=>"new", "_method"=>"get", "adapter"=>"_list_inline_adapter", "parent_model"=>"BreedingCohort", "controller"=>"litters"} User Load (0.2ms) SELECT * FROM `users` WHERE (`users`.`id` = '1') LIMIT 1
  SQL (0.1ms)   BEGIN
User Update (0.3ms) UPDATE `users` SET `updated_at` = '2011-02-04 21:40:13', `last_request_at` = '2011-02-04 21:40:13' WHERE `id` = 1
  SQL (103.6ms)   COMMIT
BreedingCohort Load (0.2ms) SELECT * FROM `breeding_cohorts` WHERE (`breeding_cohorts`.`id` = 1)
Rendered _form_attribute (2.7ms)
Rendered _form_attribute (1.7ms)
Rendered _form_attribute (3.2ms)
  Cage Columns (0.5ms)   SHOW FIELDS FROM `cages`
  Sex Columns (0.4ms)   SHOW FIELDS FROM `sexes`
StorageAssignment Columns (0.4ms) SHOW FIELDS FROM `storage_assignments`
  Slot Columns (0.4ms)   SHOW FIELDS FROM `slots`
  Grid Columns (0.4ms)   SHOW FIELDS FROM `grids`
Rendered _horizontal_subform_header (2.7ms)
SQL (0.2ms) SELECT count(*) AS count_all FROM `cages` WHERE ((litter_id IS NULL))
Rendered _form_association_footer (4.6ms)
Rendered _horizontal_subform (16.8ms)
Rendered _form_association (24.2ms)
Rendered _form (374.4ms)
Rendered _create_form (387.1ms)
Rendered _messages (1.0ms)
Rendered _list_inline_adapter (6.2ms)
Completed in 525ms (View: 10, DB: 0) | 200 OK [http://x/litters/new?_method=get&eid=5cc47093cc38d2655051963d4c6ecf6e&nested=true&parent_column=litters&parent_model=BreedingCohort&adapter=_list_inline_adapter]

and I get http://imageupload.org/?di=1312968522335

Then when clicking "Create another", the log shows:

Processing LittersController#edit_associated (for x at 2011-02-04 21:44:26) [GET] Parameters: {"eid"=>"5cc47093cc38d2655051963d4c6ecf6e", "association"=>"cages", "action"=>"edit_associated", "controller"=>"litters"}
  Cage Columns (0.4ms)   SHOW FIELDS FROM `cages`
Rendering edit_associated
  Sex Columns (0.4ms)   SHOW FIELDS FROM `sexes`
StorageAssignment Columns (0.4ms) SHOW FIELDS FROM `storage_assignments`
  Slot Columns (0.4ms)   SHOW FIELDS FROM `slots`
  Grid Columns (0.4ms)   SHOW FIELDS FROM `grids`
User Load (0.2ms) SELECT * FROM `users` WHERE (`users`.`id` = '1') LIMIT 1
  SQL (0.1ms)   BEGIN
User Update (0.2ms) UPDATE `users` SET `updated_at` = '2011-02-04 21:44:26', `last_request_at` = '2011-02-04 21:44:26' WHERE `id` = 1
  SQL (96.3ms)   COMMIT
  User Load (0.3ms)   SELECT * FROM `users`
  Group Load (0.2ms)   SELECT * FROM `groups` WHERE (`groups`.`id` = 9)
[...]
CACHE (0.0ms) SELECT * FROM `groups` WHERE (`groups`.`lft` <= 4 AND `groups`.`rgt` >= 5) ORDER BY `lft`
Rendered _form_attribute (906.2ms)
Rendered _form_attribute (1.9ms)
  Sex Load (0.2ms)   SELECT * FROM `sexes`
Rendered _form_attribute (2.6ms)
StorageAssignment Load (0.8ms) SELECT * FROM `storage_assignments` WHERE ((item_id IS NULL) AND (storage_assignments.item_type = 'Cage'))
Rendered _form_attribute (3.1ms)
Rendered _horizontal_subform_record (1029.8ms)
Completed in 1245ms (View: 1128, DB: 117) | 200 OK [http://x/litters/edit_associated?association=cages&eid=5cc47093cc38d2655051963d4c6ecf6e]

and I get http://imageupload.org/?di=512968524226

Instead of the empty selectbox (which doesn't make any sense this way), I would like to get my custom widget from the first screenshot. What am I missing?

cheers,
ben

On 02/01/2011 11:43 AM, Sergio Cambra .:: entreCables S.L. ::. wrote:
Please send log when you load new form and when you click on create another
cage

On Domingo, 30 de Enero de 2011 15:29:51 Benjamin Adler escribió:
Hello! Using rails 2.3.5 and AS, I have

Litter :has_many :cages, and

Cage
has_one :storage_assignment, :as =>  :item, :conditions =>
"storage_assignments.item_type = 'Cage'", :dependent =>  :delete

has_one :storage, :through =>  :storage_assignment, :as =>  :item

The storage_assignments-controller contains "config.subform.layout =

:custom" to implement my own UI for selecting a storage (=creating a

storage_assignment). This works fine when simply creating a new Cage.

When I go and create a new Litter, I can "Create another" Cage in the
Cages-subform using a table-ish layout. Unfortunately, this subform does
not use my custom UI for creating a Cages' storage-assignment. How can I
tell activescaffold to use my custom UI in the storage_assignment column?

--
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.

Reply via email to