Devise in Rails没有创建创建配置文件的路径

时间:2011-05-24 17:05:17

标签: ruby-on-rails ruby-on-rails-3 devise authentication

我刚用Devise创建了一堆路由,但没有创建一条值得注意的路线:创建一个帐户。

以下是我迁移过程中的内容:

create_table(:users,:options =>'ENGINE = InnoDB DEFAULT CHARSET = utf8')do | t |   t.database_authenticatable:null =>假   t.recoverable   t.rememberable   t.trackable   t.confirmable   t.encryptable

这是我相关的佣金路线

     new_user_session GET    /users/sign_in(.:format)          {:action=>"new", :controller=>"devise/sessions"}
         user_session POST   /users/sign_in(.:format)          {:action=>"create", :controller=>"devise/sessions"}
 destroy_user_session GET    /users/sign_out(.:format)         {:action=>"destroy", :controller=>"devise/sessions"}
        user_password POST   /users/password(.:format)         {:action=>"create", :controller=>"devise/passwords"}
    new_user_password GET    /users/password/new(.:format)     {:action=>"new", :controller=>"devise/passwords"}
   edit_user_password GET    /users/password/edit(.:format)    {:action=>"edit", :controller=>"devise/passwords"}
                      PUT    /users/password(.:format)         {:action=>"update", :controller=>"devise/passwords"}
    user_confirmation POST   /users/confirmation(.:format)     {:action=>"create", :controller=>"devise/confirmations"}
new_user_confirmation GET    /users/confirmation/new(.:format) {:action=>"new", :controller=>"devise/confirmations"}
                      GET    /users/confirmation(.:format)     {:action=>"show", :controller=>"devise/confirmations"}

知道为什么没有创建创建配置文件路由以及如何操作?

谢谢!

1 个答案:

答案 0 :(得分:2)

您错过了可注册模块。您可能需要将其添加到用户模型中。

示例:

class User < ActiveRecord::Base
  devise :database_authenticatable, :registerable,
    :recoverable, :rememberable, :trackable, :confirmable
end