Saturday, January 31, 2009

Re: Ajax Forms

It's pointing to edit() automatically because Cake found the Artist
ID. You need to specify the form action to override that behavior:

$form->create('Artists', array('action' => 'edit_artists'));

On Sat, Jan 31, 2009 at 12:20 AM, WidePixels <dave@widepixels.com> wrote:
>
> Wondering how to create form that will edit on a specific table.
> Example is I have a User that on their Profile has data that relates
> to a HABTM set up. For example on the user Profile there are blocks of
> data that represent Artists, Genres, and Favorites which all belong to
> the User.
>
> So when the User is viewing their own Profile they can edit specific
> areas and not 1 big form. So if they click edit artists, its a form
> that only shows the Artists part of the profile.
>
> I copied the edit function straight from baking and renamed it
> edit_artists and copied the edit form removing all the elements except
> for the artists part, and shows just the artists as I want.
> But the form when I check the rendered HTML seems to still be using
> the edit function to save the data, not my edit_artists function.
>
> The edit_artists form looks like:
>
> <div class="update artists form">
> <?php echo $form->create('Artists');?>
> <fieldset>
> <legend><?php __('Update artists');?></legend>
> <?php
> echo $form->hidden('id');
> echo $form->hidden('user_id');
> ?>
> <div class="user_checks"><?php echo $form->input('Artists',array
> ('multiple'=>'checkbox', 'label' => 'Artists:'));?></div>
> </fieldset>
> <?php echo $form->end('Submit');?>
>
> It works but is that how its supposed to work?
>
> 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: