params.require(:task).permit(:summary, comments_attributes: [:id, :content])
I want to add user_id and project_id in comments_attributes.
user_id = current_user.id
project_id = project.id
I tried with below but not working
params.require(:task).permit(:summary, comments_attributes: [:id, :content]).merge(user_id: current_user.id, comments_attributes: [user_id: current_user.id, project_id: project.id])
Please help me how can I do this?
deep_merge
is no longer a subclass ofActionController::Parameters
. I am getting anundefined method
error fordeep_merge
in Rails 5. – Silicious