Module: InlineFormsSchemaEdit
- Defined in:
- lib/inline_forms_schema_edit.rb,
lib/inline_forms_schema_edit/engine.rb,
lib/inline_forms_schema_edit/version.rb,
lib/inline_forms_schema_edit/batch_export.rb,
lib/inline_forms_schema_edit/batch_import.rb,
lib/inline_forms_schema_edit/intent_validator.rb,
lib/generators/inline_forms_schema_edit/install_generator.rb
Overview
InlineFormsSchemaEdit packages the schema-change GUI (add a field to a model
through the browser) as a mountable engine, separate from the inline_forms
runtime engine. Apps opt in at creation time (inline_forms create --schema-edit, implied by --example); apps that never change their own
schema ship without this surface entirely.
The GUI is the web layer plus the batch pipeline (persisted intents, freeze-on-submit, export/import/replay). The codegen machinery it drives lives in inline_forms: SchemaIntent (the proposed change), SchemaPreview (cheap subclass + virtual-attribute preview), SchemaApply (runs the inline_forms_addto generator; never db:migrate) and SchemaLabel (locale label writing). See stuff/2026-07-11-schema-gui-gem-and-automated-pipeline-plan.md.
Defined Under Namespace
Modules: BatchExport, Generators, IntentValidator Classes: BatchImport, Engine
Constant Summary collapse
- VERSION =
Lockstep with inline_forms / inline_forms_installer / validation_hints (see stuff/prompt/workflow.md): all gems bump together on the 8.1 line.
"8.1.47"
Class Method Summary collapse
-
.draw_routes(router) ⇒ Object
All GUI + pipeline routes, drawn from one place so gem upgrades can add routes without editing the app's routes.rb.
- .export_token ⇒ Object
Class Method Details
.draw_routes(router) ⇒ Object
All GUI + pipeline routes, drawn from one place so gem upgrades can add routes without editing the app's routes.rb. The installer writes a single line into generated apps:
InlineFormsSchemaEdit.draw_routes(self)
(Route names are kept identical to the phase-0 literal routes.)
56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/inline_forms_schema_edit.rb', line 56 def self.draw_routes(router) router.get "schema", to: "inline_forms/schema#index", as: :inline_forms_schema_index router.get "schema/new", to: "inline_forms/schema#new", as: :inline_forms_schema_new router.post "schema/preview", to: "inline_forms/schema#preview", as: :inline_forms_schema_preview router.post "schema", to: "inline_forms/schema#create", as: :inline_forms_schema router.post "schema/draft", to: "inline_forms/schema#draft", as: :inline_forms_schema_draft router.delete "schema/draft/:id", to: "inline_forms/schema#remove_draft", as: :inline_forms_schema_remove_draft router.post "schema/batch/submit", to: "inline_forms/schema#submit_batch", as: :inline_forms_schema_submit_batch router.get "schema/batches/:id/export", to: "inline_forms/schema#export", defaults: { format: :json }, as: :inline_forms_schema_export router.post "schema/batches/:id/status", to: "inline_forms/schema#batch_status", as: :inline_forms_schema_batch_status end |
.export_token ⇒ Object
38 39 40 |
# File 'lib/inline_forms_schema_edit.rb', line 38 def self.export_token @@export_token.presence || ENV["INLINE_FORMS_SCHEMA_EXPORT_TOKEN"].presence end |