Re: Scaffolding question

2007-04-18 Thread Sonic Baker
You can use the bake.php script for generate scaffolded Models, Views, and Controllers. This generates actual code so you don't have to set the $scaffold variable. You can then remove the select box from the view code and edit the controller to set the customer_id there. Cheers, Sonic

Re: Scaffolding question 2

2007-04-17 Thread Sonic Baker
Your table structure should be something like: students (id, name), awards_ students (student_id, award_id) awards (id, name, award_type_id), award_types (id, award_name) Your model associations should then be: Student hasAndBelongsToMany Award, Award hasOne AwardType Set the reverse

Re: Scaffolding question

2007-04-17 Thread Sonic Baker
If you just select the customer you want and save it the student will only be associated to that customer. If you want that customer to be already selected prior to going to the add student page, set the student id in the URL or session and edit the CustomersController::add() action to get the id

Re: Scaffolding question

2007-04-17 Thread Sergei Gerasenko
See, because there's a potential for selecting the wrong customer on the student form, that dropdown should really contain only one customer. Or that dropdown shouldn't be shown at all. Or the scaffolding should be taken down. Is there a way to get rid of the other customers in the dropdown