You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -554,6 +554,52 @@ The returned hash is a `Hashie::Mash` instance, allowing you to access parameter
554
554
The `#declared` method is not available to `before` filters, as those are evaluated prior
555
555
to parameter coercion.
556
556
557
+
### Include parent namespaces
558
+
559
+
By default `declared(params)` includes parameters that were defined in all parent namespaces. If you want to return only parameters from your current namespace, you can set `include_parent_namespaces` option to `false`.
curl -X GET -H "Content-Type: application/json" localhost:9292/parent/foo/bar
587
+
````
588
+
589
+
**Response**
590
+
591
+
````json
592
+
{
593
+
"without_parent_namespaces": {
594
+
"child_name": "bar"
595
+
},
596
+
"with_parent_namespaces": {
597
+
"parent_name": "foo",
598
+
"child_name": "bar"
599
+
},
600
+
}
601
+
````
602
+
557
603
### Include missing
558
604
559
605
By default `declared(params)` includes parameters that have `nil` values. If you want to return only the parameters that are not `nil`, you can use the `include_missing` option. By default, `include_missing` is set to `true`. Consider the following API:
0 commit comments