Tuesday, April 28, 2009

Rookie questions

I am doing something and want to know if I am going about it the right way.
 
I baked an application, and for Users which has a few HABTM tables but did not bake HABTM model or controllers. (the users_systems controller or model for example)
Now in the Users edit function i turned all the select options into checkboxes.
 
I then took all the <div class="related">code.....</div> which shows all the related info from the edit view and made individual elements with and edit button to update a div to display a form to update the individual HABTM sections rather than 1 big form.
 
Now when I save 1 of the forms which all have:
 
<?php echo $ajax->form(array('type' => 'post',
    'options' => array(
        'model'=>'User',
        'update'=>'ajax_content',
        'url' => array(
        'controller' => 'users',
        'action' => 'update'
        )
    )
)); ?>
 
My questions are:
In the sql query log i see everything related to the user being added to the query.... because I am using    'model'=>'User', in the form right?
If i changed the form to   'model'=>'User_System', and created that model would that then only query that specific model? and update the Users System selection?

thanks,
 
Dave

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: