I have this JS object:
obj = {id: 80, attr_name: "avatar", style: "small", upload_path: null}
I then post this object as params with AJAX to the controller. What I would like to see in the params is something like this:
params[:attachment][:id] = 80
params[:attachment][:attr_name] = "avatar"
and so on and on...
So on the JS side I created an object that holds attachment params:
{attachment:obj}
While I do get params[:attachment] the result it [object Object].
How can I turn my JS object into an array inside params[:attachment]?
Thanks,