Devise в Rails не создал маршрут для создания профиля - PullRequest
0 голосов
/ 24 мая 2011

Я только что создал группу маршрутов с помощью Devise, но один известный маршрут не был создан: чтобы создать учетную запись.

Вот что я имею в своей миграции:

create_table (: users,: options => 'ENGINE = InnoDB CHARSET DEFAULT = utf8') do | t | t.database_authenticatable: null => false 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 Ответ

2 голосов
/ 24 мая 2011

Вам не хватает Registerable -модуля. Возможно, вам нужно добавить его в свою модель пользователя.

Пример:

class User < ActiveRecord::Base
  devise :database_authenticatable, :registerable,
    :recoverable, :rememberable, :trackable, :confirmable
end
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...