Actions
# avo-2
f
Hi, I am adding some customer actions in an association
rails g avo:action AddAvailability
I am then registering the action in the resource (
action AddAvailability
) and add a simple
succeed 'ok'
after the models loop. The action properly appears on top of the association block, but clicking on it has no effect. The associated resources is displayed within some tabs.
l
Hi @future-author-97799, this issue persist even after restarting the server?
f
yes
I have no clue what could be the cause
Is there a way to have avo to raise an error?
l
I'll try to replicate it, can be the tabs, not sure
Inside action there is the error method
f
what do you mean?
l
Maybe i misunderstood your question, i was thinking about actions errors
@future-author-97799 i'm not able to replicate it, can you provide the code used on the action / the resource where is registred / the resource where are the tabs?
f
Sure
l
when you execute the action inside AvailabilityResource page it runs as expected?
Are you sure that the code executed in the action do not raise any error?
that one that you declared
f
ok, fine for my Loom, apologize for that
So, I think I got the issue
I want my action to appear on the Villa page, where I got the has_many availabilities
but the action is not related to a given availabity (so like you said, not for selected availabities item), but I still want to get the Villa model in my aciton
Is that possible?
Can I get the parent model?
l
np, the video make me realize the issue
l
Yes, on the ui it's silent but it should always be on the logs
What's the bug exactly?
f
The bug is about dates in action field
all the other types work
but this one, unpermitted params, and the value is not passed obvisouly
@loud-jewelry-99127 Should I fill a bug?
l
Yes please
f
will do it, but this is a quite blocking one
@loud-jewelry-99127 Here it is: https://github.com/avo-hq/avo/issues/1857
l
Hi @future-author-97799 thantks for the report, @lemon-wall-20836 just let a comment on the issue and I tried it out on my side, I see the unpermited params indeed but that's it, i can access the fields and the values normally, that log don't break on my side