To send JS variables into ERB, you gotta use Ajax. JS runs in the browser, and ERB runs in the server, so there's no way around looking up how to use $('#table').load()
there.
Unless if you could do with one of the zillion ways JS can cook its own new HTML, without ERB. The only problem then is you wouldn't be DRY, if you also needed to output that same HTML at page load time, from the server.