Use CKResourceManage to access to resources. You can get CKResourceManager object with CKApplication#resource_manager.
Main methods of CKResourceManager are url()
and path()
. url() returns URLs for resources, path() does absolute file paths. url() works only for resources in web server resources directory. You canft get URLs for resources in resources directory.
Methods | Description |
---|---|
url(name) |
Returns the public URL for the specified resource when it is under the web server resources directory. Otherwise returns nil. |
path(name) |
Returns the file path of the specified resource. |
bytedata(name) |
Returns a CKByteData object for the specified resource. |
content_type(path) |
Finds the content type for extension of the specified path. If the path don't have extension, returns nil. |