mrsnow

mrsnow

Hey.
I have a simple resource with just the default actions :read, :create, :update and added ash_admin to the project. But i can’t get ash_admin to work to generate the default forms.

This is the resource:

defmodule Elephouse.TodoList.Todo do
  use Ash.Resource,
    domain: Elephouse.TodoList,
    data_layer: AshPostgres.DataLayer

  postgres do
    table "todos"
    repo Elephouse.Repo
  end

  actions do
    defaults [:read, :create, :update]
  end

  attributes do
    uuid_v7_primary_key :id
    create_timestamp :created_at
    update_timestamp :updated_at

    attribute :title, :string do
      allow_nil? false
    end

    attribute :due_at, :naive_datetime

    attribute :completed, :boolean do
      default :false
    end

    attribute :completed_at, :naive_datetime

    attribute :hashes, :string
  end

  relationships do
    belongs_to :owner, Elephouse.Accounts.User
  end
end

My used deps:

defp deps do
    [
      {:phoenix, "~> 1.7.14"},
      {:phoenix_ecto, "~> 4.5"},
      {:ecto_sql, "~> 3.10"},
      {:postgrex, ">= 0.0.0"},
      {:phoenix_html, "~> 4.1"},
      {:phoenix_live_reload, "~> 1.2", only: :dev},
      # TODO bump on release to {:phoenix_live_view, "~> 1.0.0"},
      {:phoenix_live_view, "~> 1.0.0-rc.1", override: true},
      {:floki, ">= 0.30.0", only: :test},
      {:phoenix_live_dashboard, "~> 0.8.3"},
      {:esbuild, "~> 0.8", runtime: Mix.env() == :dev},
      {:tailwind, "~> 0.2", runtime: Mix.env() == :dev},
      {:heroicons,
       github: "tailwindlabs/heroicons",
       tag: "v2.1.1",
       sparse: "optimized",
       app: false,
       compile: false,
       depth: 1},
      {:swoosh, "~> 1.5"},
      {:finch, "~> 0.13"},
      {:telemetry_metrics, "~> 1.0"},
      {:telemetry_poller, "~> 1.0"},
      {:gettext, "~> 0.20"},
      {:jason, "~> 1.2"},
      {:dns_cluster, "~> 0.1.1"},
      {:bandit, "~> 1.5"},
      {:ash, "~> 3.0"},
      {:ash_authentication, "~> 4.0"},
      {:ash_authentication_phoenix, "~> 2.0"},
      {:ash_postgres, "~> 2.0"},
      {:ash_phoenix, "~> 2.0"},
      {:picosat_elixir, "~> 0.2.3"},
      {:ecto_psql_extras, "~> 0.8"},
      {:ash_admin, "~> 0.11.3"}
    ]
  end

Anyone a suggestion? Every help would be nice. Thanks.

Showing Posts 1 to 8

netProphET

netProphET

@mrsnow In your Domain Elephouse.TodoList did you:

  1. add the extension
use Ash.Domain, extensions: [AshAdmin.Domain]
  1. add
admin do
    show?(true)
end
mrsnow

mrsnow OP

@netProphET Yes i did that:

defmodule Elephouse.TodoList do
  use Ash.Domain,
    extensions: [AshAdmin.Domain]

  admin do
    show? true
  end

  resources do
    resource Elephouse.TodoList.Todo
  end
end

I’m seeing the admin interface and seeing the domains and resources in the admin interface but i don’t get generated forms from the default actions.

zachdaniel

zachdaniel

Creator of Ash

Can you show a screenshot/video of what your admin app looks like? If you click into the Todo resource, you should see Create/Read buttons. If you click into an individual row when looking at a read action, you should see an update button.

mrsnow

mrsnow OP

Create Todo:

Update Todo:

I assumed that there will be generated forms with the default actions.
Maybe my assumption is wrong?

zachdaniel

zachdaniel

Creator of Ash

Ah, so the forms are based on the inputs your actions accept. By default, that is none.

 actions do
    defaults [:read, create: [:list, :of, :fields], update: [:list, :of, :fields]]
  end
mrsnow

mrsnow OP

Thank you. So my assumption was not correct. Thanks for clarification.

trentjones21

trentjones21

Would it be reasonable to expect this

actions do
  defaults [:read, :destroy, create: :*, update: :*]
end

to generate forms with all inputs rendered? That is the behavior I was expecting, which lead me to this thread. In practice it renders no inputs in the form.

zachdaniel

zachdaniel

Creator of Ash

That will generate inputs for all attributes marked with public?: true.

— All posts loaded —

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews