Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

undefined method `alias_action' for Ability:Class #139

Closed
TerryM opened this Issue · 2 comments

2 participants

@TerryM

Hi,
following your documentation I tried to create my own action using the syntax
alias_action :show, :to => :read
alias_action :index, :to => :list
but I get undefined method `alias_action' for Ability:Class
so what is exact the syntax and where precisely (at the class level, in the initialize method,...) should it be define?
thanks.

@ryanb
Owner

It should be called on the instance of ability, such as the initialize method.

def initialize(user)
  alias_action :index, :to => :list
end

I'll mark this as needing better documentation.

@ryanb
Owner

make it clear in readme that alias_action is an instance method - closed by 737f8ac

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.