Rails 中的 Devise 未创建用于创建配置文件的路线

发布于 2024-11-09 07:52:55 字数 1574 浏览 2 评论 0原文

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

这是我在迁移中的内容:

create_table(:users, :options => 'ENGINE=InnoDB DEFAULT CHARSET=utf8') do |t| t.database_authenticatable :null =>错误的 t.可恢复 t.可记住的 t.可追踪 t.可确认的 t.encryptable

这是我的相关 rake 路由

     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"}

知道为什么没有创建 create-profile 路由以及如何做吗?

谢谢!

I just created a bunch of routes with Devise, but one notable route was not created: to make an account.

Here is what I have in my migration:

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

And here are my relevant rake routes

     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"}

Any idea why the create-profile route was not made and how to do it?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

双手揣兜 2024-11-16 07:52:55

您缺少可注册模块。您可能需要将其添加到您的用户模型中。

例子:

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

You're missing the Registerable-module. You probably need to add it to your User-model.

Example:

class User < ActiveRecord::Base
  devise :database_authenticatable, :registerable,
    :recoverable, :rememberable, :trackable, :confirmable
end
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文