nested_form
nested_form copied to clipboard
in update action any nested field remove then give error.
if in transaction there is product_transaction nested form. in one transaction many no. of products. save transaction then many product_transaction save in linking table with associate transaction. then if we open transaction#edit product_transaction also open. if we remove any product_transaction from transaction edit form and update then after update action it gives error.
I am also having this issue. When I click to add new object, it creates it fine and displays it within my form. Say if I click remove object. It disappears and while inspecting the html page it shows that its hidden.
Once I try and click submit, it comes back to that same page showing that the object didn't pass validations, while the params it was sending to the server showed "_destroy"=>"1".
Was wondering how to get around this problem.
Same issue here
I believe this is due to do how Rails 4 access param field. In your Controller you can do this as a quick work around.
def product_line_params
#TODO: Fix this as it is unsecure.
params.require(:product_line).permit!
end
Read this, it is part of Rails 4 core now: https://github.com/rails/strong_parameters