Last active
January 31, 2017 02:31
-
-
Save nmeylan/11486256 to your computer and use it in GitHub Desktop.
Rails redirect_to with javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def js_redirect_to(path) | |
render js: %(window.location.href='#{path}') and return | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@haryantowang09 You can use
alert(...)
inside your JavaScript block.