diff --git a/CHANGELOG.md b/CHANGELOG.md index 6438cbd86..1790f097e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project's source code will be documented in this fil Contributors: please follow the recommendations outlined at [keepachangelog.com](http://keepachangelog.com/). Please use the existing headings and styling as a guide, and add a link for the version diff at the bottom of the file. Also, please update the `Unreleased` link to compare to the latest release version. ## [Unreleased] +## [6.9.3] - 2017-04-03 + +### Fixed +- Removed call of to_json on strings when formatting props. [#791](https://github.com/shakacode/react_on_rails/pull/791) by [justin808](https://github.com/justin808) ## [6.9.2] - 2017-04-02 @@ -518,7 +522,8 @@ Best done with Object destructing: ##### Fixed - Fix several generator related issues. -[Unreleased]: https://github.com/shakacode/react_on_rails/compare/6.9.2...master +[Unreleased]: https://github.com/shakacode/react_on_rails/compare/6.9.3...master +[6.9.3]: https://github.com/shakacode/react_on_rails/compare/6.9.1...6.9.3 [6.9.2]: https://github.com/shakacode/react_on_rails/compare/6.9.1...6.9.2 [6.9.1]: https://github.com/shakacode/react_on_rails/compare/6.8.2...6.9.1 [6.9.0]: https://github.com/shakacode/react_on_rails/compare/6.8.2...6.9.0 diff --git a/app/helpers/react_on_rails_helper.rb b/app/helpers/react_on_rails_helper.rb index cd379859b..a2755761a 100644 --- a/app/helpers/react_on_rails_helper.rb +++ b/app/helpers/react_on_rails_helper.rb @@ -234,7 +234,11 @@ def json_safe_and_pretty(hash_or_string) # # Temp fix given that a hash may contain active record objects and that crashed with the new # code to JSON.pretty_generate - ERB::Util.json_escape(hash_or_string.to_json) + + # If to_json is called on a String, then the quotes are escaped. + json_value = hash_or_string.is_a?(String) ? hash_or_string : hash_or_string.to_json + + ERB::Util.json_escape(json_value) # end end