Module: Hibiki::Rails::Generators::ScaffoldSharedViews

Included in:
ScaffoldControllerGenerator
Defined in:
lib/generators/hibiki/rails/scaffold_shared_views.rb

Overview

Emitting the app-wide view partials — the page control, the field-error line and the form's error summary — into app/views/shared. All three are presentation-only: everything resource-shaped (ids, anchors, page numbers, the message) reaches them as a local or keyword, so they are ONE file per app rather than one per resource, like the transport stylesheet. Every write is idempotent: a second scaffold finds the file present and leaves it.

The wrinkle the stylesheet does not have: the emitted BODY depends on --css. Each file carries a "--css=" marker comment; a run under a different variant keeps the existing file and says so, because silently restyling every other resource's control would be worse.

Constant Summary collapse

SHARED_VIEW_DIR =
"app/views/shared"