diff options
author | José Valim <jose.valim@gmail.com> | 2011-11-25 09:49:54 +0000 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-11-25 09:49:54 +0000 |
commit | 696d01f7f4a8ed787924a41cce6df836cd73c46f (patch) | |
tree | d38247044fa4fb5eadd8c8f9182b9fa9e1f26576 /actionpack/lib/action_controller/metal/serialization.rb | |
parent | 6d9f9b3b05f6ea55aad9853888912bcca4d81c9f (diff) | |
download | rails-696d01f7f4a8ed787924a41cce6df836cd73c46f.tar.gz rails-696d01f7f4a8ed787924a41cce6df836cd73c46f.tar.bz2 rails-696d01f7f4a8ed787924a41cce6df836cd73c46f.zip |
Add docs to serializers. Update CHANGELOGs.
Diffstat (limited to 'actionpack/lib/action_controller/metal/serialization.rb')
-rw-r--r-- | actionpack/lib/action_controller/metal/serialization.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/metal/serialization.rb b/actionpack/lib/action_controller/metal/serialization.rb index 9fb49f512e..628d5996d7 100644 --- a/actionpack/lib/action_controller/metal/serialization.rb +++ b/actionpack/lib/action_controller/metal/serialization.rb @@ -1,4 +1,27 @@ module ActionController + # Action Controller Serialization + # + # Overrides render :json to check if the given object implements +active_model_serializer+ + # as a method. If so, use the returned serializer instead of calling +to_json+ in the object. + # + # This module also provides a serialization_scope method that allows you to configure the + # +serialization_scope+ of the serializer. Most apps will likely set the +serialization_scope+ + # to the current user: + # + # class ApplicationController < ActionController::Base + # serialization_scope :current_user + # end + # + # If you need more complex scope rules, you can simply override the serialization_scope: + # + # class ApplicationController < ActionController::Base + # private + # + # def serialization_scope + # current_user + # end + # end + # module Serialization extend ActiveSupport::Concern |