diff options
author | Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com> | 2016-05-09 09:55:12 -0300 |
---|---|---|
committer | Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com> | 2016-05-09 16:40:52 -0300 |
commit | c609bb619dd2c6ece85cc4d5d008e57672f80c15 (patch) | |
tree | 962634b579941b3567c6358f1d896f82b14b640c /actionview | |
parent | a0b3de3002bd9f608b3a9e41e702762b10430207 (diff) | |
download | rails-c609bb619dd2c6ece85cc4d5d008e57672f80c15.tar.gz rails-c609bb619dd2c6ece85cc4d5d008e57672f80c15.tar.bz2 rails-c609bb619dd2c6ece85cc4d5d008e57672f80c15.zip |
Improve AV changelog with regards to default RAW handler
It highlights which kind of incompatibilities this could lead to when rendering plain JS or HTML partials.
Diffstat (limited to 'actionview')
-rw-r--r-- | actionview/CHANGELOG.md | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/actionview/CHANGELOG.md b/actionview/CHANGELOG.md index e610f77f1e..7e271a693a 100644 --- a/actionview/CHANGELOG.md +++ b/actionview/CHANGELOG.md @@ -292,7 +292,24 @@ * Change the default template handler from `ERB` to `Raw`. Files without a template handler in their extension will be rendered using the raw - handler instead of ERB. + handler instead of ERB. The raw handler does not flag the rendered text as html safe, + so if your application rendered plain JS or HTML files before, you'll have to replace: + + ```erb + <%= render '/common/analytics.js' %> + ``` + + with either + + ```erb + <%= raw render '/common/analytics.js' %> + ``` + + or + + ```erb + <%= render('/common/analytics.js').html_safe %> + ``` *Rafael Mendonça França* |