{"action":"created","issue":{"url":"https://api.github.com/repos/EventedMind/iron-router/issues/1127","labels_url":"https://api.github.com/repos/EventedMind/iron-router/issues/1127/labels{/name}","comments_url":"https://api.github.com/repos/EventedMind/iron-router/issues/1127/comments","events_url":"https://api.github.com/repos/EventedMind/iron-router/issues/1127/events","html_url":"https://github.com/EventedMind/iron-router/issues/1127","id":52122930,"number":1127,"title":"Controller not defined when using CoffeeScript","user":{"login":"kevohagan","id":2431923,"avatar_url":"https://avatars.githubusercontent.com/u/2431923?v=3","gravatar_id":"","url":"https://api.github.com/users/kevohagan","html_url":"https://github.com/kevohagan","followers_url":"https://api.github.com/users/kevohagan/followers","following_url":"https://api.github.com/users/kevohagan/following{/other_user}","gists_url":"https://api.github.com/users/kevohagan/gists{/gist_id}","starred_url":"https://api.github.com/users/kevohagan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevohagan/subscriptions","organizations_url":"https://api.github.com/users/kevohagan/orgs","repos_url":"https://api.github.com/users/kevohagan/repos","events_url":"https://api.github.com/users/kevohagan/events{/privacy}","received_events_url":"https://api.github.com/users/kevohagan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-12-16T15:03:28Z","updated_at":"2015-01-22T19:29:47Z","closed_at":null,"body":"Using Meteor 1.0.1 and Iron.Router 1.0.3.\r\n\r\nIn js this works : \r\n\r\n```js\r\nBasicController = RouteController.extend({\r\n  layoutTemplate: 'layout',\r\n  loadingTemplate: 'loading'\r\n});\r\n\r\nRouter.route('/', {\r\n  name: 'home',\r\n  template: 'home',\r\n  controller: \"BasicController\"\r\n});\r\n\r\n```\r\n\r\ndoing so in coffee \r\n\r\n```coffee\r\n@BasicController = RouteController.extend(\r\n  layoutTemplate: \"layout\"\r\n  loadingTemplate: \"loading\"\r\n)\r\n\r\nRouter.route \"/\",\r\n  name: \"home\"\r\n  template: \"home\"\r\n  controller: \"BasicController\"\r\n```\r\n\r\nproduces :\r\n\r\n```\r\nException in defer callback: Error: RouteController 'BasicController' is not defined.\r\n    at resolve (http://localhost:8000/packages/iron_router.js?c45f7b94d616b48432e190827a3ca76d48e51e9d:788:15)\r\n    at Function.Route.findControllerConstructor (http://localhost:8000/packages/iron_router.js?c45f7b94d616b48432e190827a3ca76d48e51e9d:810:12)\r\n    at Function.Route.createController (http://localhost:8000/packages/iron_router.js?c45f7b94d616b48432e190827a3ca76d48e51e9d:828:16)\r\n    at Function.Router.createController (http://localhost:8000/packages/iron_router.js?c45f7b94d616b48432e190827a3ca76d48e51e9d:1107:24)\r\n    at Function.Router.dispatch (http://localhost:8000/packages/iron_router.js?c45f7b94d616b48432e190827a3ca76d48e51e9d:1662:23)\r\n    at locationComputation (http://localhost:8000/packages/iron_router.js?c45f7b94d616b48432e190827a3ca76d48e51e9d:1746:25)\r\n    at Tracker.Computation._compute (http://localhost:8000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:288:36)\r\n    at new Tracker.Computation (http://localhost:8000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:206:10)\r\n    at Object.Tracker.autorun (http://localhost:8000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:476:11)\r\n    at Function.Router.start (http://localhost:8000/packages/iron_router.js?c45f7b94d616b48432e190827a3ca76d48e51e9d:1739:36)\r\n```"},"comment":{"url":"https://api.github.com/repos/EventedMind/iron-router/issues/comments/71082508","html_url":"https://github.com/EventedMind/iron-router/issues/1127#issuecomment-71082508","issue_url":"https://api.github.com/repos/EventedMind/iron-router/issues/1127","id":71082508,"user":{"login":"mediatainment","id":1597621,"avatar_url":"https://avatars.githubusercontent.com/u/1597621?v=3","gravatar_id":"","url":"https://api.github.com/users/mediatainment","html_url":"https://github.com/mediatainment","followers_url":"https://api.github.com/users/mediatainment/followers","following_url":"https://api.github.com/users/mediatainment/following{/other_user}","gists_url":"https://api.github.com/users/mediatainment/gists{/gist_id}","starred_url":"https://api.github.com/users/mediatainment/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediatainment/subscriptions","organizations_url":"https://api.github.com/users/mediatainment/orgs","repos_url":"https://api.github.com/users/mediatainment/repos","events_url":"https://api.github.com/users/mediatainment/events{/privacy}","received_events_url":"https://api.github.com/users/mediatainment/received_events","type":"User","site_admin":false},"created_at":"2015-01-22T19:29:47Z","updated_at":"2015-01-22T19:29:47Z","body":"same here:\r\n\r\nDoes not work\r\n\r\n```ruby\r\nRouter.configure \r\n  layoutTemplate: \"MasterLayout\"\r\n\r\nRouter.route \"/\", ->\r\n  @render \"welcome\"\r\n````\r\n\r\nDoes work\r\n\r\n```ruby\r\nRouter.configure({\r\n  layoutTemplate: \"MasterLayout\",\r\n  loadingTemplate: \"Loading\",\r\n  notFoundTemplate: \"NotFound\"\r\n});\r\n\r\nRouter.route(\"/\", function() {\r\n  return this.render(\"welcome\");\r\n});\r\n```"}}