I have the line below in a method that is an endpoint in my Rails API:
render json: { :template => render_to_string(:template => "emails/cases/approved.html.erb").html_safe }
The user sends a request to the server (POST) with some data, dependent on the data the user POSTs the server sends back an HTML "template"
It is an ERB template already rendered, and that's all working fine. However, when Rails sends back the HTML as a string with the populated variables in the ERB template, the string looks like this:
HTML:
<!doctype html>
And Rails response:
\u003c!doctype html\u003e\n\u003chtml
How can I prevent Rails from converting it to unicode characters?