Nested scaffold generator for Rails 4.2 and 5
Ruby HTML JavaScript CSS Logos
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
gemfiles rails 5.0.0 final Jul 2, 2016
lib/generators
test
.document Initial commit to nested_scaffold. Dec 12, 2010
.gitignore From jeweler to bundler Mar 31, 2016
.travis.yml rails 5.0.0 final Jul 2, 2016
Gemfile
LICENSE.txt Initial commit to nested_scaffold. Dec 11, 2010
README.md
Rakefile Don't test the generated tests in the generator test Mar 31, 2016
nested_scaffold.gemspec

README.md

nested_scaffold

A scaffold command that generates a set of perfectly working nested resource for Rails 4.2 and 5.

Features

  • Generates a nested child resource with a single command
  • Generates a beautifully working bunch of code
  • Automatically generates the appropriate model associations for ActiveRecord
  • Haml ready

Rails versions

4.2, 5.0

Install

Put this line in your Gemfile:

gem 'nested_scaffold'

Then bundle.

Usage

% rails generate nested_scaffold PARENT_NAME/NAME [field:type field:type] [options]

(Expects PARENT model to exist in advance)

Example

While "Post" model exists,

% rails g nested_scaffold post/comment name:string content:text

This will create:

  • comment {model, controller, helper, views, tests}
  • nested resource route
  • Post.has_many :comments association

Options

Basically same as the original scaffold.

TODO / known issues

  • namespace (who needs?)
  • third party orms
  • fixture replacements

Contributing to nested_scaffold

Pull requests are welcome on GitHub at https://github.com/amatsuda/nested_scaffold

Copyright

Copyright (c) 2010 Akira Matsuda. The gem is available as open source under the terms of the MIT License.