An API scaffold generator for Grape which generates controller, models and specs.
Add this line to your Rails application's Gemfile:
gem 'grape-scaffold'
And then execute:
$ bundle
The scaffold generator works similar to the Rails scaffold, it takes the model name and it's attributes as arguments.
$ rails g grape:scaffold Model [Attributes]
- --skip-model-tests - Skip model tests
- --skip-controller-tests - Skip controller tests
- --controller-path=CONTROLLER_PATH - This can be used to set the path where the controller is generated. By default it's generated under
app/controllers/api/v1/
The controller generator can be used to generate only the controller and controller specs.
$ rails g grape:controller Model
- --skip-controller-tests - Skip controller tests
- --controller-path=CONTROLLER_PATH - This can be used to set the path where the controller is generated. By default it's generated under
app/controllers/api/v1/
Available under the MIT License.