提交 e67c28df 编写于 作者: R Rizwan Reza

Added headings to serializers.

上级 7d7d54fa
en:
errors:
# The default format use in full error messages.
# The default format to use in full error messages.
format: "%{attribute} %{message}"
# The values :model, :attribute and :value are always available for interpolation
......
......@@ -2,6 +2,7 @@
require 'active_support/core_ext/class/attribute'
module ActiveModel
# == Active Model JSON Serializer
module Serializers
module JSON
extend ActiveSupport::Concern
......@@ -14,8 +15,8 @@ module JSON
self.include_root_in_json = true
end
# Returns a JSON string representing the model. Some configuration is
# available through +options+.
# Returns a JSON string representing the model. Some configuration can be
# passed through +options+.
#
# The option <tt>ActiveModel::Base.include_root_in_json</tt> controls the
# top-level behavior of to_json. It is true by default. When it is <tt>true</tt>,
......
......@@ -5,6 +5,7 @@
require 'active_support/core_ext/hash/slice'
module ActiveModel
# == Active Model XML Serializer
module Serializers
module Xml
extend ActiveSupport::Concern
......@@ -131,6 +132,8 @@ def add_procs
end
end
# Returns XML representing the model. Configuration can be
# passed through +options+.
def to_xml(options = {}, &block)
Serializer.new(self, options).serialize(&block)
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册