Is there a scaffold generator for Rails 3 that accommodates nested resources?
Rails 2.3 had
https://github.com/jeremyf/rspec_on_rails_nested_scaffold
https://github.com/mahkhaled/NestedRestfulScaffold
https://github.com/nilesh/nested-scaffold
but I don't find anything similar for Rails 3.
For quick prototypes, it'd be convenient not to have to tweak views after running a scaffold generator for nested resources.
To generate a fully working scaffold for a new object, including model, controller, views, assets, and tests, use the rails g scaffold command. Then you can run rake db:migrate to set up the database table. Then you can visit http://localhost:3000/widgets and you'll see a fully functional CRUD scaffold.
A scaffold command that generates a set of perfectly working nested resource for Rails 4.2 and 5.
Rails scaffolding is a quick way to generate some of the major pieces of an application. If you want to create the models, views, and controllers for a new resource in a single operation, scaffolding is the tool for the job.
I just created one. https://github.com/amatsuda/nested_scaffold
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With