Skip to content

Instantly share code, notes, and snippets.

@nmeylan
Last active January 31, 2017 02:31
Show Gist options
  • Save nmeylan/11486256 to your computer and use it in GitHub Desktop.
Save nmeylan/11486256 to your computer and use it in GitHub Desktop.
Rails redirect_to with javascript
def js_redirect_to(path)
render js: %(window.location.href='#{path}') and return
end
@rageandqq
Copy link

@haryantowang09 You can use alert(...) inside your JavaScript block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment