josevalim/inherited_resources — Issue #204: Namespaces: undefined method `all' for Api:Module
Author: coneybeare
Created: 2012-02-01 18:39:05+00:00
State: open

I have some namespaced controllers that live in`app/controllers/api/` and each are subclasses of an `ApiController`. This `ApiController` is a subclass of `InheritedResources::Base`.

When attempting to get the index on one of the `Api::FooController` subclasses, I get this error:

undefined method `all' for Api:Module

with this backtrace:

inherited_resources (1.3.0) lib/inherited_resources/base_helpers.rb:25:in `collection'
inherited_resources (1.3.0) lib/inherited_resources/actions.rb:7:in `index'
…

Changing the `Api::FooController` subclass to `InheritedResources::Base` allows it to work, but doesn't pull in my `ApiController` superclass that I need it to. Can inherited_resources be used if the controller is not a direct subclass of `InheritedResources::Base`?