{"action":"created","issue":{"url":"https://api.github.com/repos/appcelerator/alloy/issues/695","labels_url":"https://api.github.com/repos/appcelerator/alloy/issues/695/labels{/name}","comments_url":"https://api.github.com/repos/appcelerator/alloy/issues/695/comments","events_url":"https://api.github.com/repos/appcelerator/alloy/issues/695/events","html_url":"https://github.com/appcelerator/alloy/pull/695","id":84009657,"number":695,"title":"The name of a controller, model or collection doesn't support names with / at start","user":{"login":"Topener","id":1898949,"avatar_url":"https://avatars.githubusercontent.com/u/1898949?v=3","gravatar_id":"","url":"https://api.github.com/users/Topener","html_url":"https://github.com/Topener","followers_url":"https://api.github.com/users/Topener/followers","following_url":"https://api.github.com/users/Topener/following{/other_user}","gists_url":"https://api.github.com/users/Topener/gists{/gist_id}","starred_url":"https://api.github.com/users/Topener/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Topener/subscriptions","organizations_url":"https://api.github.com/users/Topener/orgs","repos_url":"https://api.github.com/users/Topener/repos","events_url":"https://api.github.com/users/Topener/events{/privacy}","received_events_url":"https://api.github.com/users/Topener/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-02T12:53:59Z","updated_at":"2015-06-03T11:42:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/appcelerator/alloy/pulls/695","html_url":"https://github.com/appcelerator/alloy/pull/695","diff_url":"https://github.com/appcelerator/alloy/pull/695.diff","patch_url":"https://github.com/appcelerator/alloy/pull/695.patch"},"body":"The name of the controller can also be a relative path. But to make it uniform (just like with images) you should be able to add a `/` in front of the name/path. It currently doesn't support that. This fix resolves that for controllers,models and collections, and adds to the documentation it can also be a relative path.\r\n\r\nAn example why this should be supported is because it is consistent for everything. Image names/paths with a leading `/` on Android is even required, and a controller name/path with a leading `/` is generating errors. This leads to unexpected issues, and confusion. \r\n\r\nThis fix makes it consistent:\r\n\r\n```javascript\r\nAlloy.createController('name'); // will work\r\nAlloy.createController('/path/to/controller'); // will also work\r\n$.imageView.image = '/path/to/image.png' // will (only) work\r\nAlloy.createCollection('name'); // will work\r\nAlloy.createCollection('/path/to/collection'); // will work\r\n```\r\n\r\nConsistent behaviour across all names/paths leads to expected functionality. Exceptions make it confusion. This PR fixes that"},"comment":{"url":"https://api.github.com/repos/appcelerator/alloy/issues/comments/108326980","html_url":"https://github.com/appcelerator/alloy/pull/695#issuecomment-108326980","issue_url":"https://api.github.com/repos/appcelerator/alloy/issues/695","id":108326980,"user":{"login":"Topener","id":1898949,"avatar_url":"https://avatars.githubusercontent.com/u/1898949?v=3","gravatar_id":"","url":"https://api.github.com/users/Topener","html_url":"https://github.com/Topener","followers_url":"https://api.github.com/users/Topener/followers","following_url":"https://api.github.com/users/Topener/following{/other_user}","gists_url":"https://api.github.com/users/Topener/gists{/gist_id}","starred_url":"https://api.github.com/users/Topener/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Topener/subscriptions","organizations_url":"https://api.github.com/users/Topener/orgs","repos_url":"https://api.github.com/users/Topener/repos","events_url":"https://api.github.com/users/Topener/events{/privacy}","received_events_url":"https://api.github.com/users/Topener/received_events","type":"User","site_admin":false},"created_at":"2015-06-03T11:42:55Z","updated_at":"2015-06-03T11:42:55Z","body":"@feons if you make directories in the controller folder, you can just include `path/to/controller/in/a/folder.js`, and do a `Alloy.createController('path/to/controller/in/a/folder').`. This works, and has always worked. \r\n\r\nAlso a neat way of organizing your app and splitting controllers up. \r\n\r\n"}}