How to redirect to root page in jQuery?

Now I am redirected to the main page in my Rails application using

redirect_to root_path 

I want to do the same in jQuery.

i.e. window.location.replace("???");

How to do it?

+4
source share
1 answer

window.location = '/'

The disadvantage of using window.location.replace('/') is that the user cannot click "Back" and return to the previous page.

+13
source

Source: https://habr.com/ru/post/1303662/


All Articles