Cannot seems to figure out how I can post a query(json) array to a rails controller#action
I have just like
var myarray = []; ( with values )
My controller action I want to post to:
def process
end
Everywhere I find answers on how to get JSON -> Jquery
But Ill need the other way around. Anyone knows how to do this? Can’t be that hard?!
There’s probably a few ways to do this, but here’s one. Use some JS like this to post to your controller:
Then, in your controller:
Now you have an array that matches what you had in javascript.