New View Routes

Add or remove view routes

Creating new routes

Adding a new route

$ node-rails new-page (url route name)

Assets that were created

A new view page

A new view pug template gets created with all of its assets for webpack in the views/pages directory based on the route and page you have given. The route is added to the file tree. ./views/pages/blogs/cool-blog.pug

A new javascript asset

A new javascript asset based on your settings gets created with webpack support in the assets/(js-type) directory based on the route and page you have given. The route is added to the file tree. ./assets/(js-type)/pages/blogs/cool-blog.(js-type)

A new style asset

A new style asset based on your settings gets created with webpack support in the assets/(style-type) directory based on the route and page you have given. The route is added to the file tree. ./assets/(style-type)/pages/blogs/cool-blog.(style-type)

A new declaration in routes in app.js

A new route get defined in app.js, do not move the comment in app.js for the route generation will not be created if removed however the assets will with webpack.

New Route Example

Creating an example blog route

$ node-rails new-page '/blogs'

Side Notes

Removing a route

Remove all the files created listed above, then remove the route declared in the app.js file.

Short hand alias

$ node-rails np '/blogs'