Im very much a newbie to ruby, and am stuck with what is probably a very simple fix...

I am creating a system that creates html pages, which a client can download.

So, I have one project, that has many details, meta tags, images etc. Each one of these has its own model, and db table, and they are all setup with has_many (Project) and belongs_to (details, meta tags, images etc) relationships.

This all worked fine, create, show, edit etc until the database id fields on the tables went out of sync during working on the validations.

So I added in the project_id column on the tables as a backup plan so they are not all running off the id column that auto increments...

Now, when I click 'show' on my project, I get the error: Couldn't find Image with ID=43, and thats because there is no image with the id on the table as it went out of sync.

So how do I make it so that when I click 'show', it gets the project_id of the image instead of the id?

Hope that makes sense? It may not be the best way of doing it, and im still learning, so any suggestions are welcomed.