我刚刚用Devise创建了一堆路由,但有一条值得注意的路由没有创建:创建一个帐户。
以下是我迁移过程中的内容:
create_table(:users,:options=>'ENGINE=InnoDB DEFAULT CHARSET=utf8')do | t|t.database_authenticatable:null=>falset.可收回t.Remembert.trackablet.confirmablet.可加密
以下是我的相关耙路
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"}
知道为什么没有制作创建配置文件路线以及如何制作吗?
谢谢!
您缺少可注册-模块。您可能需要将其添加到用户模型中。
示例:
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :confirmable
end