instance method
from_json
Ruby on Rails 3.2.22.5
Since v3.0.20Signature
from_json(json, include_root=include_root_in_json)
No documentation comment.
Parameters
-
jsonreq -
include_rootopt = include_root_in_json
Source
# File activemodel/lib/active_model/serializers/json.rb, line 100
def from_json(json, include_root=include_root_in_json)
hash = ActiveSupport::JSON.decode(json)
hash = hash.values.first if include_root
self.attributes = hash
self
end
Defined in activemodel/lib/active_model/serializers/json.rb line 100
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Serializers::JSON