{"_id":"55fd9c6f56d6990d00a6caa9","version":{"_id":"55fd9c6d56d6990d00a6ca9d","project":"54d64e6b276f8e0d00feab95","__v":1,"createdAt":"2015-09-19T17:33:33.368Z","releaseDate":"2015-09-19T17:33:33.368Z","categories":["55fd9c6e56d6990d00a6ca9e","55fd9c6e56d6990d00a6ca9f","55fd9c6e56d6990d00a6caa0"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.4.0","version":"1.4.0"},"category":{"_id":"55fd9c6e56d6990d00a6ca9f","version":"55fd9c6d56d6990d00a6ca9d","project":"54d64e6b276f8e0d00feab95","__v":1,"pages":["55fd9c6f56d6990d00a6caa9","55fd9c6f56d6990d00a6caaa","55fd9c6f56d6990d00a6caab","55fd9c6f56d6990d00a6caac","55fd9c6f56d6990d00a6caad","55fd9c6f56d6990d00a6caae","55fd9c6f56d6990d00a6caaf","55fd9c6f56d6990d00a6cab0","55fd9c6f56d6990d00a6cab1"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-02-07T17:51:18.995Z","from_sync":false,"order":1,"slug":"generators","title":"Generators"},"__v":0,"project":"54d64e6b276f8e0d00feab95","user":"54d64e31276f8e0d00feab94","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-02-07T17:52:41.522Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"# Usage\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ kick generate state <name> [<substates>...] [options]\\n$ kick g state <name> [<substates>...] [options]\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Available Options\",\n  \"body\": \"* --abstract (-a) \\n* --no-controller (-nc)\"\n}\n[/block]\n# Description \n\nThis will generate a view and a controller for the state under the `app/states` folder. Each state's new root state will create a route file in `app/config/routes` folder, nested states will be included in that file. It will also generate unit tests for each controller and a stylesheet for each root state.\n\nTo create a nested state, either separate it from the parent state with slashes, e.g.:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ kick generate state orders/new\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nOr using spaces. In which case, you can pass as many substates as you like, e.g.:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ kick generate state emails inbox sent archive\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nwill create 4 states: 'emails', 'emails.inbox', 'emails.sent' and 'emails.archive'. All of them will appear in `app/config/routes/emails.js file.\n\n\n# CRUD States\n\nWhen you pass 'crud' as a substate, it will automatically create 4 substates:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ kick generate state users crud\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\ngenerates 'users', 'users.list', 'users.new', 'users.show', 'users.edit'","excerpt":"","slug":"state","type":"basic","title":"State"}
# Usage [block:code] { "codes": [ { "code": "$ kick generate state <name> [<substates>...] [options]\n$ kick g state <name> [<substates>...] [options]", "language": "shell" } ] } [/block] [block:callout] { "type": "success", "title": "Available Options", "body": "* --abstract (-a) \n* --no-controller (-nc)" } [/block] # Description This will generate a view and a controller for the state under the `app/states` folder. Each state's new root state will create a route file in `app/config/routes` folder, nested states will be included in that file. It will also generate unit tests for each controller and a stylesheet for each root state. To create a nested state, either separate it from the parent state with slashes, e.g.: [block:code] { "codes": [ { "code": "$ kick generate state orders/new", "language": "shell" } ] } [/block] Or using spaces. In which case, you can pass as many substates as you like, e.g.: [block:code] { "codes": [ { "code": "$ kick generate state emails inbox sent archive", "language": "shell" } ] } [/block] will create 4 states: 'emails', 'emails.inbox', 'emails.sent' and 'emails.archive'. All of them will appear in `app/config/routes/emails.js file. # CRUD States When you pass 'crud' as a substate, it will automatically create 4 substates: [block:code] { "codes": [ { "code": "$ kick generate state users crud", "language": "shell" } ] } [/block] generates 'users', 'users.list', 'users.new', 'users.show', 'users.edit'