How should HTTP Post look like for saving model and associated model data?
问题 I am using Cakephp 2.4.5. I have 2 tables with a one-to-many relationship. Table B belongs to Table A. I want a controller in Table A that can save records in Table A and Table B. The controller code should be simple and looks like this; public function add_tableA($id=null) { if ($this->request->is('post')) { $this->layout = null ; $this->TableA->create(); $this->TableA->saveAll($this->request->data, array('deep' => true)); } } My problem comes when trying to send the right HTTP POST format