Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when submitting nested form images with a model #18

Open
wraithseeker opened this issue Nov 17, 2015 · 1 comment
Open

Error when submitting nested form images with a model #18

wraithseeker opened this issue Nov 17, 2015 · 1 comment

Comments

@wraithseeker
Copy link

I have a model A that uses Carrierwave Crop and when I submit a nested form that includes multiple model Bs that has an image, I get the following error. Character is Model B.

Model A has many Model B and Model B belongs to Model A

undefined method `image_coverpage_crop_x' for #<Character:0x007fcfdd064528>
if @vn.update(vn_params) // This is the line that raises the error

I have ensured that the strong params in Model A includes the cropping fields and that it allows nested attributes. Everything works fine if I update Model A by itself or Model B by itself. Updating all of them at the same time causes the error.

@wraithseeker
Copy link
Author

My quick and dirty fix was to include this field in Model B which does not actually exist and only exists in Model A. Is there a better workaround other than this to solve the issue?

crop_uploaded :image_coverpage 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant