voxdolo/decent_exposure — pull request #106 by jtomaszewski (2014-01-21 15:20:31+00:00)
Title: Fix 'wrong constant name' error (Rails 4.1.0beta1)

I keep having 'NameError: wrong constant name' wherever I use any kind of `expose` in my controllers in Rails 4.1 (was working great in 4.0).

So I digged a little and the reason is that:
```rb
path # => "CarsController"
path[0...(path.rindex('::') || 0)] # => "" (empty string)
"".constantize # (rails 4.0) => Object
"".constantize # (rails 4.1) => NameError: wrong constant name
```

Here is a small change that fixes that.
P.S. maintainers of `mongoid` gem had [similar problem](https://github.com/mongoid/mongoid/pull/3475).