Created
February 8, 2015 22:44
-
-
Save KatrinaHoffert/1879ef766fdaae6c0937 to your computer and use it in GitHub Desktop.
Demoing reverse routing
This file contains hidden or 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
<input id="locationId" type="hidden" value="123" /> | |
<button id="submitButton">Submit</button> | |
<script> | |
$("#submitButton").on("click", function() { | |
// TODO: check if set, first, and handle case of not set | |
var locationId = $("#locationId").val(); | |
var destUrl = jsRoutes.controllers.LocationController | |
.showLocation(locationId).url; | |
window.location(destUrl); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment