mikesax
I’m starting to play with Ash, because I feel it will give me the DRYness of Rails and the clarity of Elixir & Phoenix. I roughly followed the Postgres how-to guide on the Ash framework website but I’m getting an error that I can’t explain, running this code:
Marketing.Lead
|> Ash.Changeset.for_create(:create, %{email: "mike@example.com", farmer: true})
|> Ash.create!()
This yields an error:
(elixir 1.16.2) lib/process.ex:860: Process.info/2
(ash 3.1.3) lib/ash/error/invalid/no_such_input.ex:5: Ash.Error.Invalid.NoSuchInput."exception (overridable 2)"/1
(ash 3.1.3) lib/ash/changeset/changeset.ex:2034: anonymous fn/4 in Ash.Changeset.cast_params/4
...
I suspect it has something to do with the definition of my resource. Any ideas on how to figure out what’s causing this? Thank you for your time!
defmodule Marketing.Lead do
use Ash.Resource, domain: Marketing, data_layer: AshPostgres.DataLayer
postgres do
table "leads"
repo Muck.Repo
end
actions do
defaults [:read]
create :create
end
attributes do
uuid_primary_key :id
attribute :email, :string do
allow_nil? false
end
attribute :farmer, :boolean do
allow_nil? false
default false
end
attribute :writer, :boolean do
allow_nil? false
default false
end
attribute :academic, :boolean do
allow_nil? false
default false
end
attribute :other, :string
end
end
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
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
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted”
Version...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #blog-post
- #ai
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 3- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
zachdaniel
By default, an action does not accept any attributes as inputs. To resolve this, you have two options:
acceptlist. this is the simplest:*, which means all public attributesFor example:
This option is a bit more complex because
public?affects other things like visibility over external APIs, etc.mikesax
Thank you Zach, that was exactly it! My mistake for overlooking that part of the Getting Started guide. It might be useful to make a minor change to the Getting Started guide:
…changing “customize” to something that indicates that adding
acceptwith a list of attributes is not optional? Or maybe adding# accepts (list of attributes)?Would it sense to have a more granular error, from “NoSuchInput” to “InputNotAccepted”, which would have likely lead me (and other future beginning Ash users) to the cause of the error?
I greatly appreciate all your work!
zachdaniel
Yeah, I think updating the docs there is likely the best way to go, even just to indicate that we’ll be accepting things later, like
instead of just
create :createwould help with some of the confusion. I think we want to keep it toNoSuchInputbecause the type of error is used by things like api extensions to show error messages, and we want to make sure that its not possible for API extensions to leak internal resource details.but, we can add “hints” that are in the error message on
NoSuchInput, like “an attribute with this name exists, but is not accepted by the action. Perhaps you need to add it to theacceptlist of the action?”If you could open issues or PRs for these two improvements, that would be wonderful