I was wondering if there was a way to do a redirect inside a js.erb file. I’m converting an app to use ajax so it feels snappier, but my create action leaves the user on the index page.
I could do something like:
window.location.replace("/model/@object.id")
But I’d prefer to do a full blown redirect_to model_path(@object) if it is possible?
If anyone finds this, here’s my code in my List’s create.js.erb: