我有一个版本化的 API,我正在使用设计进行身份验证,我在路由中添加了以下内容并得到下面的错误。
如何设计将常量解析为 Api::V1::User 而不是 ApiV1User?
devise_for :api_v1_users
错误信息:
/Users/danielcrompton/.rvm/rubies/ruby-1.9.3-p448/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/danielcrompton/.rvm/gems/ruby-1.9.3-p448/bin/rake default
Testing started at 11:25 AM ...
/Users/danielcrompton/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/inflector/methods.rb:230:in `block in constantize': uninitialized constant ApiV1User (NameError)
from /Users/danielcrompton/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/inflector/methods.rb:229:in `each'
from /Users/danielcrompton/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/inflector/methods.rb:229:in `constantize'
from /Users/danielcrompton/.rvm/gems/ruby-1.9.3-p448/gems/devise-3.1.0/lib/devise.rb:285:in `get'
from /Users/danielcrompton/.rvm/gems/ruby-1.9.3-p448/gems/devise-3.1.0/lib/devise/mapping.rb:77:in `to'
from /Users/danielcrompton/.rvm/gems/ruby-1.9.3-p448/gems/devise-3.1.0/lib/devise/mapping.rb:72:in `modules'
from /Users/danielcrompton/.rvm/gems/ruby-1.9.3-p448/gems/devise-3.1.0/lib/devise/mapping.rb:89:in `routes'
from /Users/danielcrompton/.rvm/gems/ruby-1.9.3-p448/gems/devise-3.1.0/lib/devise/mapping.rb:156:in `default_used_route'
from /Users/danielcrompton/.rvm/gems/ruby-1.9.3-p448/gems/devise-3.1.0/lib/devise/mapping.rb:66:in `initialize'
from /Users/danielcrompton/.rvm/gems/ruby-1.9.3-p448/gems/devise-3.1.0/lib/devise.rb:319:in `new'
from /Users/danielcrompton/.rvm/gems/ruby-1.9.3-p448/gems/devise-3.1.0/lib/devise.rb:319:in `add_mapping'
from /Users/danielcrompton/.rvm/gems/ruby-1.9.3-p448/gems/devise-3.1.0/lib/devise/rails/routes.rb:210:in `block in devise_for'
from /Users/danielcrompton/.rvm/gems/ruby-1.9.3-p448/gems/devise-3.1.0/lib/devise/rails/routes.rb:209:in `each'
from /Users/danielcrompton/.rvm/gems/ruby-1.9.3-p448/gems/devise-3.1.0/lib/devise/rails/routes.rb:209:in `devise_for'
from /**removed**/config/routes.rb:5:in `block (3 levels) in <top (required)>'
...