I'm using the devise_invitable gem along with Devise but I can't figure out how to show a list of all invited users. I want to list all invited users with their status of accepted/pending.
I have already made a custom Invitations controller (as per the official documentation) that inherits from Devise's controller in which I have a super statement so that it doesn't change functionality but rather adds some below the super. I've scoured issues related to this one and found very few but they use a completely different and unrelated approach. Any input is appreciated~
For example, trying to access @users from invitations/new view throws an undefined method 'each'.
If you have an
invitations_controlleryou can simply add this:You don't need to inherit from Devise, just from the
ApplicationController. You will be able to access the@usersvariable, now if you want to separate the results into two separate arrays then:And your view you can access the
@pending_usersas well as@accepted_users