i have line below in method endpoint in rails api:
render json: { :template => render_to_string(:template => "emails/cases/approved.html.erb").html_safe }
the user sends request server (post) data, dependent on data user posts server sends html "template"
it erb template rendered, , that's working fine. however, when rails sends html string populated variables in erb template, string looks this:
html:
<!doctype html>
and rails response:
\u003c!doctype html\u003e\n\u003chtml
how can prevent rails converting unicode characters?
render json: {template: raw(render_to_string(template: "emails/cases/approved.html.erb"))}