https://avo.cool logo
ElRecordoSong
# general
m
I just rails new'd a new app. I have avo installed with pundit. I'm in the admin interface. I have a policy for the resource and an active_record model backing it but I don't see the resource in the view. Are there any common gotchas that I should look out for?
l
Hello @mammoth-guitar-49791 can you share your ApplicationPolicy?
My guess is that
def index?
is not defined or returning
false
and your resource
ElRecordoSong
will not even show up on the menu
l
override
def index?
on
ElRecordoSongPolicy
to return
true
and it should appear
m
I just tried that but still nothing is showing up.
l
Share your solution pls on the recordo policy
ah got it
missing
?
on the method
index
❌
index?
✅
l
Also notice that
index?
should be defined inside policy class but not inside the
Scope
class
Copy code
ruby
class ElRecordoSongPolicy < ApplicationPolicy
  def index? = true

  class Scope < Scope
  end
end
even if I change index to true on application policy it doesn't work
l
Uncomment the
resolve
method on the
ElRecordoSongPolicy
l
Hmm this last error seems to be raised when you do something like
config.assets....
I don't think it's avo related and cant figure it out without reproducing it
About the
ElRecordoSong
resource, it's already displaying?
This is the repo
I was missing propshaft from my bundle and now everything is wokring
l
I was giving a look into the repo, how did you generated the resources? Avo should prefill some fields based on your schema
m
Copy code
bin/rails generate avo:resource TandaAudioTrasnfer --force
2 Views