Where is the proper place to escape quotes in Play Framework?
I have the following flow: A user is presented with a form. He fills in the form fields, and submits to the controller, which persists this to the DB On another page, the Controller gets this record from the DB, and passes it to the view The view captures it as a javascript variable: var foo = '${user.bar}'; Now, if the user enters this string in the form: I have a quote - ' - very dangerous then the quote is passed through all the way to the DB and back, and results in a corrupt javascript statement: var foo = 'I have a quote - ' - very dangerous'; What is the best place to escape this