attachment_fu with extra db fields?


The reason is that the name of the form field for the project id is

See how the file upload is image[uploaded_data] ? That is being
parsed in the controller into the image object but the project_id is
not because of how it is setup.

Try this for the hidden field:

<%= hidden_field_tag 'image[project_id]', params[:id] %>

I haven't tried this but you see what I'm getting at...

Or, keep your original and then in the controller, something like:

image.project = Project.find(params[:project_id])