Module: Hibiki::Rails::Generators::NestedHelpers

Included in:
NestedGenerator
Defined in:
lib/generators/hibiki/rails/nested_helpers.rb

Overview

Naming, mode detection and preflight for hibiki:rails:nested. The generator takes two names — parent and child — plus an optional field list; NamedBase carries only the parent, so everything child-shaped is derived here.

Two modes, decided from what is on disk:

root  the parent is a scaffolded resource — the fieldset goes into
    its row form, the params.expect group into its controller.
deep  the parent is itself a nested child (its _<parent>_fields
    partial exists somewhere under app/views) — the fieldset nests
    into that partial and every other injection walks up to the
    resource that owns it. Depth is composition: one run per edge.