deepc
Hi,
I am new to the language and library and getting to know things by building an app. I’ve run into a problem where the following :content attribute on the following Resource disappears when I try to type anything into the JSON editor input field in the ash_admin interface
Here is a video of the problem: 404 File Not Found - Jumpshare
In the terminal output I see the following. _target doesnt seem correct and im not sure if its a configuration issue on my end. It goes from content => undefined
[debug] HANDLE EVENT "validate" in AshAdmin.PageLive
Component: AshAdmin.Components.Resource.Form
Parameters: %{"_target" => ["form", "content"], "form" => %{"_form_type" => "update", "content" => "{\n \"asda\": \"aasg\"\n}", "id" => "cf8b8181-de34-4f09-a086-a3224fad5d38", "publish_from" => "2024-07-25T22:33", "publish_to" => "", "summary" => "Test summary", "title" => "asdasdasdada"}}
[debug] Replied in 287µs
[debug] HANDLE EVENT "validate" in AshAdmin.PageLive
Component: AshAdmin.Components.Resource.Form
Parameters: %{"_target" => ["undefined"], "form" => %{"_form_type" => "update", "content" => "{\n \"asda\": \"aasg\"\n}", "id" => "cf8b8181-de34-4f09-a086-a3224fad5d38", "publish_from" => "2024-07-25T22:33", "publish_to" => "", "summary" => "Test summary", "title" => "asdasdasdada"}}
defmodule ContentCove.Articles.Story do
use Ash.Resource,
otp_app: :content_cove,
domain: ContentCove.Articles,
data_layer: AshPostgres.DataLayer,
extensions: [AshAdmin.Resource]
postgres do
table "stories"
repo ContentCove.Repo
end
actions do
defaults [:read, :destroy]
default_accept [:title, :content, :summary, :publish_from, :publish_to]
create :create do
argument :tags, {:array, :uuid} do
allow_nil? true
end
change relate_actor(:created_by)
change relate_actor(:updated_by)
end
update :update do
require_atomic? false
argument :tags, {:array, :uuid} do
allow_nil? true
end
change relate_actor(:created_by)
change relate_actor(:updated_by)
change manage_relationship(:tags, type: :append_and_remove)
end
read :by_id do
argument :id, :uuid, allow_nil?: false
get? true
filter expr(id == ^arg(:id))
end
end
attributes do
uuid_primary_key :id
create_timestamp :inserted_at
update_timestamp :updated_at
attribute :summary, :string
attribute :publish_from, :utc_datetime do
allow_nil? false
end
attribute :publish_to, :utc_datetime
attribute :title, :string do
allow_nil? false
end
attribute :content, :map do
allow_nil? false
end
end
relationships do
belongs_to :created_by, ContentCove.Accounts.User do
allow_nil? false
end
belongs_to :updated_by, ContentCove.Accounts.User do
allow_nil? false
end
many_to_many :tags, ContentCove.Articles.Tag do
through ContentCove.Articles.StoryTag
source_attribute_on_join_resource :story_id
destination_attribute_on_join_resource :tag_id
end
end
end
The field is basically just meant to be one that accepts any valid JSON atm.
I have a feeling this has maybe got to do with some sort of validation issue on the field but not too sure. Any help would be appreciated ![]()
Thanks!
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
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
Anyone here using Honeybadger?
My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of
Bandit.HTTPError...
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
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
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
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
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #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
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
zachdaniel
deepc
Hi!
When I load the page I only see this error in the browser console
No errors in the terminal window when loading or saving despite the field in the UI for that field going boom.
When I type valid JSON into the input. I see update events logged to the console but the input disappears in a split second. I’ve attached the console log:
My mix.exs deps are the following:
deepc
I have got this weird issue in vs-code too but I think its unrelated
mix deps.get doesnt seem to resolve it, spark is specified in my mix.exs and the .formatter file in the root dir
zachdaniel
I’ve reproduced the error, will try to fix in the next day or two.
zachdaniel
Can you try
ash_adminfrommain?{:ash_admin, github: "ash-project/ash_admin"}deepc
Yep that works! Thanks for the speedy assistance
I wonder if you can help me with the following issues. I am not 100% sure they are related to ash however.
I see this error in the browser console:
I cannot seem to figure out where it is getting the old asset version from. Could it be a case of LiveView not having updated one of their client-side files or maybe one of the deps? All my deps point to the latest releases
I cannot for the life of me figure out why the formatter wont work.
The deps are there and up to date
zachdaniel
Try deleting the
.elixir_lsfolderdeepc
Thanks, took a bit of fiddling such as reinstalling the plugin too but it looks back to normal
Any idea about the LiveView asset version mismatch issue? Do you get the same?
zachdaniel
I do notice this, yes. I’m not entirely sure what the fix is, but it does seem like a warning that can probably be safely ignored for now. We can figure it out further if there are other behavioral issues that arise.
deepc
Awesome thanks so much for your assistance. I’m enjoying learning and using your library so far! Quite intuitive for someone like myself from a Python/JS background. I’m still getting use to how the documentation in the ecosystem is structured and how to find the relevant information quickly within the docs. More real world examples would be awesome
For example something as simple as associating a user to a specific field automatically i.e a created_by field took some digging and I think only came across relate_actor by chance from a post within this forum. So simple to implement (thanks to your library) just finding out how to do such a thing terminology wise is something I’m still getting use to
Thanks again Zach!