Sha256: 110416a777f1c02ba11ed8e8206365fac4a8cc8f5a0d148c60a9e074d6e87c4b
Contents?: true
Size: 751 Bytes
Versions: 23
Compression:
Stored size: 751 Bytes
Contents
# *Flexirest:* Root elements If your response comes back with a root node and you'd like to ignore it, you can define the mapping as: ```ruby class Feed < Flexirest::Base post :list, "/feed", ignore_root: "feed" end ``` This also works if you'd want to remove a tree of root nodes: ```ruby class Feed < Flexirest::Base post :list, "/feed", ignore_root: ["feed", "items"] end ``` Alternatively if you want to wrap your JSON request body in a root element, e.g.: ```json { "feed": { "id": 1 } } ``` You can do it like this: ```ruby class Feed < Flexirest::Base post :list, "/feed", wrap_root: "feed" end Feed.list(id: 1) ``` ----- [< Default parameters](default-parameters.md) | [Required parameters >](required-parameters.md)
Version data entries
23 entries across 23 versions & 1 rubygems