views:

23

answers:

1

I'm attempting to create a simple 'tags' type of setup, allowing admins to 'tag' an image so it shows up in certain places. I've only started development and wanted to tackle this portion first. I literally just finished running bake, so everything at the moment is standard and I haven't touched any of the generated code.

I have three tables - Tags, Images, and Images_Tags. When I hit /images/add I see the tags I've created listed in a nice multi-select box. I enter the info, select some tags, hit submit. Once saved, I'm redirected to the index and I noticed there are no tags listed for the image I just created. Digging deeper, there are no records in the Images_tags table either.

I'm thinking something is off with my model, or I have a bad database column name somewhere that's borking the default methodology.

Any ideas where I could look? I'm a newbie to cakePHP, go easy on me :)

A: 

Here are a couple of things to look at.

From the sounds of things, the images are not being saved. This means that if images are not being saved, nothing will appear in the images_tags table. So the images create/save feature needs to be looked at more closely.

To troubleshoot this, since you have not touched the code, use scaffolding:

var $scaffold;

in the top of the controller and try adding the image again. See if that will allow you to add images. Typically, when something like this happens, its because the schema for the table has changed after baking all of the functionality for the table.

cdburgess