The volt command provides various helpers for managing a project and working with its data.
You can use volt new project_name
to create a new project. The new command will setup the basic app structure and is the recommended way to create new projects.
NOTE: volt new is the only command that should be run without bundle exec
in front of it. All other commands should use bundle exec
The generate command can be used to create code stubs for you.
bundle exec volt generate model NAME COMPONENT
NAME is the name of the model you want to generate. This should be singular. If COMPONENT is not specified, the main
component is assumed.
Example:
bundle exec volt generate model item
bundle exec volt generate component NAME
The component generator creates a component for you in app
.
Example:
bundle exec volt generate component blog
bundle exec volt generate gem NAME
Gem generates the files for a component gem. Component gems allow you to easily reuse components between projects.
bundle exec volt generate view NAME COMPONENT
'view' generates the files for a Volt view. If a matching model controller is not present, it is created as well.
It optionally can be passed a component, but defaults to main
.
bundle exec volt generate task NAME COMPONENT
'task' generates the files for a Volt task. It optionally can be passed a component, but defaults to main
.
bundle exec volt generate controller NAME COMPONENT
'model controller' generates the files for a Volt model controller. It optionally can be passed a component, but defaults to main
.
bundle exec volt generate http_controller NAME COMPONENT
'http_controller' generates the files for a Volt HTTP Controller. It optionally can be passed a component, but defaults to main
.
bundle exec volt server
Server runs the server on port 3000 by default.
Options:
TODO: finish docs for precompile
bundle exec volt runner path/to/file.rb
Runner is an easy way to run code inside of the volt environment. Runner takes the path to a ruby file to be run.
TODO:...