ruby-on-rails – Devise Invitable:未初始化的常量

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – Devise Invitable:未初始化的常量前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用devise,它工作正常,现在我尝试使用devise_invitable.
我正确安装它,但是当我尝试访问时我收到错误

http://localhost:3000/users/invitation/new

错误是:

Started GET "/users/invitation/new" for 127.0.0.1 at 2011-07-06 20:47:07 -0300

ActionController::RoutingError (uninitialized constant Users):


Rendered /Users/Fernando/.rvm/gems/ruby-1.9.2-head/gems/actionpack-3.0.7/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.9ms)


The routes looks like ok,and I dont know why it return this error.

路线:

accept_user_invitation
GET    /users/invitation/accept(.:format)
   {:action=>"edit",:controller=>"devise/invitations"}

user_invitation
POST   /users/invitation(.:format)              
   {:action=>"create",:controller=>"devise/invitations"}

new_user_invitation 
GET    /users/invitation/new(.:format)          
   {:action=>"new",:controller=>"devise/invitations"}

解决方法

实际上,您必须将您的邀请控制器保存在app / controllers下的用户目录中才能使用.

所以你最终会得到:

/app/controllers/users/invitations_controller.rb

这样做会摆脱这种统一的常数误差.

猜你在找的Ruby相关文章