{"id":2803,"date":"2015-09-21T16:55:55","date_gmt":"2015-09-21T14:55:55","guid":{"rendered":"https:\/\/sgaul.de\/?p=2803"},"modified":"2015-09-21T14:25:41","modified_gmt":"2015-09-21T12:25:41","slug":"api-namespace-fuer-activeadmin","status":"publish","type":"post","link":"https:\/\/sgaul.de\/2015\/09\/21\/api-namespace-fuer-activeadmin\/","title":{"rendered":"API-Namespace f\u00fcr ActiveAdmin"},"content":{"rendered":"

In ActiveAdmin kann man neben dem Standard\u00a0weitere Namespaces definieren. Hierf\u00fcr wird bei der Ressourcen-Registrierung die entsprechende\u00a0Option angegeben:<\/p>\n

# app\/admin\/api\/my_resource.rb\r\n\r\nActiveAdmin.register MyResource, namespace: :api do\r\n # ...<\/pre>\n

Das Namespace-Verzeichnis kann unter app\/admin<\/code> abgelegt werden, ohne das „admin“ Teil der URL, des Controller-Namens o. \u00e4. wird:<\/p>\n

rake routes\r\n# ...\r\napi_my_resources GET  \/api\/my_resources(.:format)  api\/my_resources#index\r\n# ...<\/pre>\n","protected":false},"excerpt":{"rendered":"

In ActiveAdmin kann man neben dem Standard\u00a0weitere Namespaces definieren. Hierf\u00fcr wird bei der Ressourcen-Registrierung die entsprechende\u00a0Option angegeben: # app\/admin\/api\/my_resource.rb ActiveAdmin.register MyResource, namespace: :api do # … Das Namespace-Verzeichnis kann unter app\/admin abgelegt werden, ohne das „admin“ Teil der URL, des Controller-Namens o. \u00e4. wird: rake routes # … api_my_resources GET \/api\/my_resources(.:format) api\/my_resources#index # …<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[91],"tags":[608,527,553,552],"_links":{"self":[{"href":"https:\/\/sgaul.de\/wp-json\/wp\/v2\/posts\/2803"}],"collection":[{"href":"https:\/\/sgaul.de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sgaul.de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sgaul.de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sgaul.de\/wp-json\/wp\/v2\/comments?post=2803"}],"version-history":[{"count":1,"href":"https:\/\/sgaul.de\/wp-json\/wp\/v2\/posts\/2803\/revisions"}],"predecessor-version":[{"id":2804,"href":"https:\/\/sgaul.de\/wp-json\/wp\/v2\/posts\/2803\/revisions\/2804"}],"wp:attachment":[{"href":"https:\/\/sgaul.de\/wp-json\/wp\/v2\/media?parent=2803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sgaul.de\/wp-json\/wp\/v2\/categories?post=2803"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sgaul.de\/wp-json\/wp\/v2\/tags?post=2803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}