For update form with params?
I'm wondering, when using
for_update
on an existing resource, do I need to explicitly make a params map? I was expecting it'd be auto populated. Even when I did Map.take/2
on the resource and put that as params it didn't work because params expect string keys. Am I missing something or is this expected? 🤔8 Replies
You shouldn't need to it should automatically show those existing values when using the standard patterns
hmm, okay, thought so. guess I'm missing something, I'll figure it out 👍
currently did
guess that's wrong
I tried the Tunez approach, i.e. adding extension AshPhoenix to my resource and using
form_to_update
but still it doesn't show existing values 🤔
might be a fluxon thing :Snope, that's fine
what does your form look like?
what does your action look like?
just an update: 😗
update: :*
and I have a define :update
does the resource have public attributes? they're the only ones that will show up on the form
yes, they are public. like I said, might be a fluxon_ui thing? maybe it just looks in params
without seeing any code, hard to say
and in it for example:
form = MyApp.MyResource.form_to_update(my_record) |> to_form()
let me just check the fluxon code
I guess it's a fluxon thing, nothing else comes to mind 🤷