Skip to content

Commit

Permalink
Fix JSON escaping inside HAML/JS templates
Browse files Browse the repository at this point in the history
More info here:
haml/haml#940
  • Loading branch information
lostie committed Apr 25, 2018
1 parent 22dd7b8 commit 8a8539d
Showing 1 changed file with 2 additions and 4 deletions.
@@ -1,7 +1,5 @@
- data = { A: ExpenseType::REASON_SET_A.values, B: ExpenseType::REASON_SET_B.values }
:javascript
var MOJ = MOJ || {};

MOJ.ExpenseReasons = {
"A": #{ExpenseType::REASON_SET_A.values.to_json},
"B": #{ExpenseType::REASON_SET_B.values.to_json}
};
MOJ.ExpenseReasons = #{data.to_json.html_safe}

0 comments on commit 8a8539d

Please sign in to comment.