Has anybody else had an issue with
# avo-2
m
Has anybody else had an issue with actions not displaying for their model resource? I generate a toggle_hidden action then define action ToggleHidden in my video_resource I don't define anything in this action but nothing shows up and there is no error. I have defined filters and they work.
l
if you're using pundit and the authorization feature you should enable the actions using the
def act_on?
method in that resource policy
m
ahhhh!!! yes that fixed it!
It would be nice to add some sort of warning that you might want to add the policy. 🤔
l
it's in the docs
where can we show that warning better?
but we're open for suggestions 😅
m
I meant warning in the rails console. That the action tried to load but was blocked by a policy. If you are defining an action but the policy isn't there, then it would be great for it to provide some sort of warning in the logs.
l
hmm. yes, that might be a solution
but that would pop up in the console when you don't want to allow a user to
act_on
that resource
m
I wouldn't mind actually helping out and contributing if it's a small thing. I have never worked on open source before.
l
we! would! just! love! that!