Is there a way to redirect after few second only by using rails?
I want when A user click on a link see the page and after few second get redirected to his profile(user_path)
Because HTML is part of a Rails application you could use the standard html redirect option by default:
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yourdomain.com/index.html">
Change 0
to number of seconds you want to wait before redirection.
On the other hand you could use javascript (also part of rails applications):
<html>
<head>
<script type="text/javascript">
function delayedRedirect(){
window.location = "/default.aspx"
}
</script>
</head>
<body onLoad="setTimeout('delayedRedirect()', 3000)">
<h2>You'll be redirected soon!</h2>
</body>
</html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With