{"action":"created","issue":{"url":"https://api.github.com/repos/iron-meteor/iron-cli/issues/161","labels_url":"https://api.github.com/repos/iron-meteor/iron-cli/issues/161/labels{/name}","comments_url":"https://api.github.com/repos/iron-meteor/iron-cli/issues/161/comments","events_url":"https://api.github.com/repos/iron-meteor/iron-cli/issues/161/events","html_url":"https://github.com/iron-meteor/iron-cli/issues/161","id":91970392,"number":161,"title":"Incorrect controller syntax when `iron create some-app --js=coffee`  ","user":{"login":"camstuart","id":3146022,"avatar_url":"https://avatars.githubusercontent.com/u/3146022?v=3","gravatar_id":"","url":"https://api.github.com/users/camstuart","html_url":"https://github.com/camstuart","followers_url":"https://api.github.com/users/camstuart/followers","following_url":"https://api.github.com/users/camstuart/following{/other_user}","gists_url":"https://api.github.com/users/camstuart/gists{/gist_id}","starred_url":"https://api.github.com/users/camstuart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camstuart/subscriptions","organizations_url":"https://api.github.com/users/camstuart/orgs","repos_url":"https://api.github.com/users/camstuart/repos","events_url":"https://api.github.com/users/camstuart/events{/privacy}","received_events_url":"https://api.github.com/users/camstuart/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-30T03:52:16Z","updated_at":"2015-06-30T04:27:12Z","closed_at":null,"body":"When generating a new project with:\r\n\r\n```\r\niron create some-app --js=coffee\r\n```\r\n\r\nThe home controller looks like this:\r\n\r\n```CoffeeScript\r\nHomeController = RouteController.extend(\r\n  layoutTemplate: 'MasterLayout'\r\n  subscriptions: ->\r\n  action: ->\r\n    @render 'Home'\r\n    return\r\n)\r\n``` \r\n\r\nWhich generates the following error in the browser console:\r\n\r\n```\r\nException in defer callback: Error: RouteController 'HomeController' is not defined.\r\n    at resolve (http://localhost:3000/packages/iron_router.js?7b16fe70bccff9182aca02afb2ccd7708ac57c64:789:15)\r\n    at Function.Route.findControllerConstructor (http://localhost:3000/packages/iron_router.js?7b16fe70bccff9182aca02afb2ccd7708ac57c64:811:12)\r\n    at Function.Route.createController (http://localhost:3000/packages/iron_router.js?7b16fe70bccff9182aca02afb2ccd7708ac57c64:838:16)\r\n    at Function.Router.createController (http://localhost:3000/packages/iron_router.js?7b16fe70bccff9182aca02afb2ccd7708ac57c64:1130:24)\r\n    at Function.Router.dispatch (http://localhost:3000/packages/iron_router.js?7b16fe70bccff9182aca02afb2ccd7708ac57c64:1693:23)\r\n    at onLocationChange (http://localhost:3000/packages/iron_router.js?7b16fe70bccff9182aca02afb2ccd7708ac57c64:1782:25)\r\n    at Tracker.Computation._compute (http://localhost:3000/packages/tracker.js?6d0890939291d9780f7e2607ee3af3e7f98a3d9c:327:36)\r\n    at new Tracker.Computation (http://localhost:3000/packages/tracker.js?6d0890939291d9780f7e2607ee3af3e7f98a3d9c:243:10)\r\n    at Object.Tracker.autorun (http://localhost:3000/packages/tracker.js?6d0890939291d9780f7e2607ee3af3e7f98a3d9c:566:11)\r\n    at Function.Router.start (http://localhost:3000/packages/iron_router.js?7b16fe70bccff9182aca02afb2ccd7708ac57c64:1775:36)\r\n```\r\n\r\nTo fix the issue, I do two things:\r\n\r\n1) Add coffeescript package:\r\n\r\n```\r\niron add coffeescript\r\n```\r\n\r\n2) Modify the coffescript code within the home_controller.coffee file\r\n\r\n```CoffeeScript\r\nclass @HomeController extends RouteController\r\n  layoutTemplate: 'MasterLayout'\r\n  subscriptions: ->\r\n  action: ->\r\n    @render 'Home'\r\n    return\r\n```\r\n\r\nProbably not strictly an issue with iron-meteor itself, when a typical iron-router controller written in JavaScript is converted to CoffeeScript, the incorrect syntax is generated. \r\n\r\nI assume iron-meteor generates JavaScripts and just converts via some third party module?\r\n\r\n@cmather, I'm happy to help (via pull request) if you would like to provide me with a solution approach that you would be happy merge, and point me in the right direction within the code base? "},"comment":{"url":"https://api.github.com/repos/iron-meteor/iron-cli/issues/comments/116951953","html_url":"https://github.com/iron-meteor/iron-cli/issues/161#issuecomment-116951953","issue_url":"https://api.github.com/repos/iron-meteor/iron-cli/issues/161","id":116951953,"user":{"login":"cmather","id":262179,"avatar_url":"https://avatars.githubusercontent.com/u/262179?v=3","gravatar_id":"","url":"https://api.github.com/users/cmather","html_url":"https://github.com/cmather","followers_url":"https://api.github.com/users/cmather/followers","following_url":"https://api.github.com/users/cmather/following{/other_user}","gists_url":"https://api.github.com/users/cmather/gists{/gist_id}","starred_url":"https://api.github.com/users/cmather/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmather/subscriptions","organizations_url":"https://api.github.com/users/cmather/orgs","repos_url":"https://api.github.com/users/cmather/repos","events_url":"https://api.github.com/users/cmather/events{/privacy}","received_events_url":"https://api.github.com/users/cmather/received_events","type":"User","site_admin":false},"created_at":"2015-06-30T04:27:12Z","updated_at":"2015-06-30T04:27:12Z","body":"Thanks Cameron I'll try to take a look this week.\n\n\n\n> On Jun 29, 2015, at 8:52 PM, Cameron Stuart <notifications@github.com> wrote:\n> \n> When generating a new project with:\n> \n> iron create some-app --js=coffee\n> The home controller looks like this:\n> \n> HomeController = RouteController.extend(\n>   layoutTemplate: 'MasterLayout'\n>   subscriptions: ->\n>   action: ->\n>     @render 'Home'\n>     return\n> )\n> Which generates the following error in the browser console:\n> \n> Exception in defer callback: Error: RouteController 'HomeController' is not defined.\n>     at resolve (http://localhost:3000/packages/iron_router.js?7b16fe70bccff9182aca02afb2ccd7708ac57c64:789:15)\n>     at Function.Route.findControllerConstructor (http://localhost:3000/packages/iron_router.js?7b16fe70bccff9182aca02afb2ccd7708ac57c64:811:12)\n>     at Function.Route.createController (http://localhost:3000/packages/iron_router.js?7b16fe70bccff9182aca02afb2ccd7708ac57c64:838:16)\n>     at Function.Router.createController (http://localhost:3000/packages/iron_router.js?7b16fe70bccff9182aca02afb2ccd7708ac57c64:1130:24)\n>     at Function.Router.dispatch (http://localhost:3000/packages/iron_router.js?7b16fe70bccff9182aca02afb2ccd7708ac57c64:1693:23)\n>     at onLocationChange (http://localhost:3000/packages/iron_router.js?7b16fe70bccff9182aca02afb2ccd7708ac57c64:1782:25)\n>     at Tracker.Computation._compute (http://localhost:3000/packages/tracker.js?6d0890939291d9780f7e2607ee3af3e7f98a3d9c:327:36)\n>     at new Tracker.Computation (http://localhost:3000/packages/tracker.js?6d0890939291d9780f7e2607ee3af3e7f98a3d9c:243:10)\n>     at Object.Tracker.autorun (http://localhost:3000/packages/tracker.js?6d0890939291d9780f7e2607ee3af3e7f98a3d9c:566:11)\n>     at Function.Router.start (http://localhost:3000/packages/iron_router.js?7b16fe70bccff9182aca02afb2ccd7708ac57c64:1775:36)\n> To fix the issue, I do two things:\n> \n> 1) Add coffeescript package:\n> \n> iron add coffeescript\n> 2) Modify the coffescript code within the home_controller.coffee file\n> \n> class @HomeController extends RouteController\n>   layoutTemplate: 'MasterLayout'\n>   subscriptions: ->\n>   action: ->\n>     @render 'Home'\n>     return\n> Probably not strictly an issue with iron-meteor itself, when a typical iron-router controller written in JavaScript is converted to CoffeeScript, the incorrect syntax is generated.\n> \n> I assume iron-meteor generates JavaScripts and just converts via some third party module?\n> \n> @cmather, I'm happy to help (via pull request) if you would like to provide me with a solution approach that you would be happy merge, and point me in the right direction within the code base?\n> \n> —\n> Reply to this email directly or view it on GitHub.\n> \n"}}