Saturday, October 2, 2010

Master/Detail edit.ctp

I've got a model with a hasMany association with a files table.
Basically, any model item can have a variable number of files attached
to it using the MeioUpload plugin. In the Items add.ctp, I accommodate
a varying number of files by putting up a single File field (I know
that each Item will have at least one File) and add more File fields,
as necessary through JavaScript (actually jQuery). All that works
great.

However, on the edit.ctp for the Items model, things get a little more
complicated. I'd like to display the existing Files associated with
the model and give the user the ability to add additional files, as
well as remove existing files.

I don't want to re-invent the wheel, so I'm wondering if anyone has an
example of how they might have done this or has any suggestions about
an efficient, cake way to do this. I'm sure it's a common need; I just
haven't needed it yet.

Also, if anyone has any recommendations regarding any master/detail
plugins or articles or such, they'd be greatly appreciated.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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: