Is there a class method that aliases index to list? Something like
‘alias :index => :list’ which causes :list to handle :index requests?
Ruby does have an ‘alias’ method, but it doesn’t seem to work like this.
Is there a class method that aliases index to list? Something like
‘alias :index => :list’ which causes :list to handle :index requests?
Ruby does have an ‘alias’ method, but it doesn’t seem to work like this.
Thanks,
Joe
alias_method :list, :index should work as long as you do this:
def index
paginate…
render :action => ‘index’
end
This way your aliased #list action still renders the correct action.
However, I stopped using list actions since the need was being filled
by #index in all my cases.