weathertopper / family-photo-project

0 stars 0 forks source link

FOR ANY ERROR WHEN RETURNING TO NEW, MAKE SURE TO RE-PASS PARAMS, LIKE POSTER_ID #36

Closed weathertopper closed 7 years ago

weathertopper commented 7 years ago

Not a bad bug to have. To fix this, save all params passed to 'new' via the 'params' object as @instance_variables. Also save those same params to the same @instance_variables in 'create' (but that time they will be coming form 'model_name_params'). Then in your form use the @instance_variables instead of the params or model_name_params. Look at the memory controller & form for an example. This is still a bug in other places, so fix them all.

weathertopper commented 7 years ago

Note, have to do the same thing for 'update' as well since it also relies on _form

weathertopper commented 7 years ago

^^but in that case, pull the value from the @object itself (it's been created once, it's there)

weathertopper commented 7 years ago

I think I fixed this in all of the places that needed fixing, but I don't remember how. Oh well :)