Skip to content

Improve STI / Polymorphic creation flow with type selection #3717

Open
@Paul-Bob

Description

@Paul-Bob

Context

  • Make this a guide

https://www.loom.com/share/31c8999bce3640ed9c69558472a74d06


  • Build a new view component for type selection
  • Add meta to the resource where the developer can configures the entities like
  • Use meta[:entities] on the new view component to
  • Add some links on the view component, each link redirecting to a STI / polymorphic type creation
def entities
    return @resource.meta[:entities] if @resource.meta[:entities].present?

    @resource.record.class.descendants
  end

  self.meta = {
    entities: [Spouse, Sibling]
  }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Next up

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions