moxley

moxley

I’m trying to understand how to define a generic action, following the documentation. A generic action has a run option that appears to be where the work is done. There is a code example available that shows what using run with an anonymous function looks like for a happy path. All good so far.

The documentation for the run option gives a type spec of (any, any -> any) | module | module. What is any, any, and any supposed to be? What does the module in the type spec need to define? There’s no explanation under the “Doc” for run.

At the top of the actions.action documentation, it says “For calling this action, see the Ash.Domain documentation.”. Following that link goes to a fairly sparse page that has no mention of custom actions.

Is there another place in the documentation that talks about generic actions in more detail?

Showing Posts 1 to 9

barnabasJ

barnabasJ

Ash Core Team

Here is the behaviour you need to implement Ash.Resource.Actions.Implementation — ash v3.29.3

This should be referenced somewhere in the generic actions doc. If you’d like you could PR that.

The types should also clarify what the (any, any → any) should be. The anonymous function doesn’t take options.

moxley

moxley OP

Thank you. How do you return an error? The Ash.Resource.Actions.Implementation documentation only provides a spec of {:error, term()}.

barnabasJ

barnabasJ

Ash Core Team

The best thing to return there is either a built-in or custom exception.

But anything would potentially work and would be wrapped in an Ash.Error.Unknown exception.

moxley

moxley OP

Thank you

moxley

moxley OP

If you’d like you could PR that.

I’ve contributed documentation PRs to Ash before.

I’ve been using Ash for over a year in production now. The documentation has been a major pain point the entire time, every step of the way.

Ash’s documentation has been really, really, REALLY frustrating. It’s hard to hide that frustration as I ask question after question about how to use Ash on this forum. I’ve never had to ask questions on a forum to understand a software tool before, let alone ask a continuous string of questions over the course of a year. I still find myself asking after all this time, “should I tear Ash out of my application?”.

Are the maintainers aware of this, or is it just too big of a problem to address in the foreseeable future?

If I submitted a PR every time I ran into clearly missing documentation, I’d be spending all my time on writing documentation for the Ash Framework rather than on the software I’m using it for.

moxley

moxley OP

Here are some suggestions for improving the documentation:

  1. For documentation on topic A, if understanding of A requires familiarity with topic B, then mention, and provide a link, to topic B.
  2. Fill in the type specs. No more any() or term().
  3. Fill in empty spots where there should be text.
zachdaniel

zachdaniel

Creator of Ash

We are aware, and this is the next major item on the docket. All reference documentation on every package will be gone over, including ensuring every function has typespecs, every option to every function is documented, and cross links exist to relevant guides etc.

zachdaniel

zachdaniel

Creator of Ash

For context on “when” there isn’t a timeline so to speak, but this is labeled as “v3.5” in my notes. So literally the next thing that will happen.

moxley

moxley OP

Wonderful. That’s great to hear @zachdaniel! Thank you for providing this framework to the community.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
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
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
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
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
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
marciok
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
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews