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