diff options
author | Prem Sichanugrist <s@sikachu.com> | 2011-04-28 15:56:11 +0700 |
---|---|---|
committer | Prem Sichanugrist <s@sikachu.com> | 2011-05-03 03:21:43 +0700 |
commit | 8c9e4d520291871e5319bc0e0a890527d8aea099 (patch) | |
tree | d6733837636fe79992e5deb9702b65f98c7cdd6a /railties/lib | |
parent | 23eb81a3d1eb154a3aefe569408d1bb2ed63c554 (diff) | |
download | rails-8c9e4d520291871e5319bc0e0a890527d8aea099.tar.gz rails-8c9e4d520291871e5319bc0e0a890527d8aea099.tar.bz2 rails-8c9e4d520291871e5319bc0e0a890527d8aea099.zip |
Add `ActionController::ParamsWrapper` to wrap parameters into a nested hash
This will allow us to do a rootless JSON/XML request to server.
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt | 12 |
1 files changed, 12 insertions, 0 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 new file mode 100644 index 0000000000..60137ed2bb --- /dev/null +++ b/railties/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt @@ -0,0 +1,12 @@ +# Be sure to restart your server when you modify this file. +# +# This file contains the settings for ActionController::ParametersWrapper +# which will be enabled by default in the upcoming version of Ruby on Rails. + +# Enable parameter wrapping for JSON. You can disable this by set :format to empty array. +ActionController::Base.wrap_parameters :format => [:json] + +# Disable root element in JSON by default. +if defined?(ActiveRecord) + ActiveRecord::Base.include_root_in_json = false +end |