Ash FrameworkAF
Ash Framework6mo ago
8 replies
D B Simmons

Spark - reading child options

Hi All

I have defined the following DSL

  crud do
    attributes([:name, :email, :joined])
    root_url("/crud")

    read do
      layout(&AshCrudWeb.Layouts.app/1)
    end
  end


I can use the following to get the value of root_url...

    root_url =
      Spark.Dsl.Extension.get_opt(resource, [:crud], :root_url, nil, true)


Reading the docs I thought I could get the value of layout with....

    layout = Spark.Dsl.Extension.get_opt(resource, [:crud, :read], :layout, nil, true)


but this always returns nil despite the fact the value is configured. I've read the Spark docs and I'm getting myself confused (easily done). Any pointers as to what I'm doing wrong? Many thanks in advance.
Was this page helpful?