josevalim/inherited_resources — pull request #315 by evilguc (2013-09-09 11:42:52+00:00)
Title: fix for resource_class default value definition

This fix solves problems with default value definition for resource_class accessor.

Example:
we have model

```ruby
Controller::User
```

and Controller for it:

```ruby
Controller::UsersController
```

Old behavior causes wrong definition of resource_class:

```ruby
'Controller::UsersController'.sub(/Controller/, '').singularize # 'UsersController'
'UsersController'.constantize # raises exception and resource_class becomes nil
```

My solution is to substitute 'Controller' postfix from controller name. So Controller::UsersController matches Controller::User model