Skip to content Skip to sidebar Skip to footer

Rendering Haml File In A Javascript Response With Rails

I am trying to render a haml file in a javascript response like so: $('#<%= @email.unique_name %> .preview .mail_content').html('<%=j render( :file => 'user_mailer/#{@e

Solution 1:

I experienced a similar problem. Problem exists because both methods, 'escape_javascript' and 'json_escape' are aliased as 'j' (https://github.com/rails/rails/pull/3578).

Answer : Use 'escape_javascript' instead of 'j'.

Post a Comment for "Rendering Haml File In A Javascript Response With Rails"