diff options
author | Xavier Noria <fxn@hashref.com> | 2011-08-16 11:19:20 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-16 11:19:20 -0700 |
commit | 98fac9902b3cc8984ad6645e0db390fb8cb55098 (patch) | |
tree | a8160d245864a3244b44fd7d29c613dc137a29c7 /railties | |
parent | 0245792c833c8b13fe53f8ae9f477b63dab928b6 (diff) | |
parent | 8e236152457ed48bb436e9bffb4c5d6d4b6a26d4 (diff) | |
download | rails-98fac9902b3cc8984ad6645e0db390fb8cb55098.tar.gz rails-98fac9902b3cc8984ad6645e0db390fb8cb55098.tar.bz2 rails-98fac9902b3cc8984ad6645e0db390fb8cb55098.zip |
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt index b7b344a62d..d640f578da 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt @@ -3,12 +3,14 @@ # This file contains settings for ActionController::ParamsWrapper which # is enabled by default. -<%= app_const %>.configure do - # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. - config.action_controller.wrap_parameters = { <%= key_value :format, "[:json]" %> } +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters <%= key_value :format, "[:json]" %> +end - <%- unless options.skip_active_record? -%> - # Disable root element in JSON by default. - config.active_record.include_root_in_json = false - <%- end -%> +<%- unless options.skip_active_record? -%> +# Disable root element in JSON by default. +ActiveSupport.on_load(:active_record) do + self.include_root_in_json = false end +<%- end -%> |