diff --git a/app/helpers/react_on_rails_helper.rb b/app/helpers/react_on_rails_helper.rb index bbd4b38c3..0d394cee7 100644 --- a/app/helpers/react_on_rails_helper.rb +++ b/app/helpers/react_on_rails_helper.rb @@ -223,10 +223,10 @@ def server_render_js(js_expression, options = {}) private def json_safe_and_pretty(something) - if Rails.env.development? - ERB::Util.json_escape(JSON.pretty_generate(something.as_json)) - else + if Rails.env.production? ERB::Util.json_escape(something.to_json) + else + ERB::Util.json_escape(JSON.pretty_generate(something.as_json)) end end