sinatra-resources
sinatra-resources copied to clipboard
Added support for setting conditions on resources
To build an API I wanted to not repeat a condition to e.g. accept only JSON on every nested route of a resource, so I added support to specify them on a resource. Nested conditions will take higher priority, so a nested resource with a different condition than the parent will overwrite that setting. Hope this is useful to someone else.