0

提交一个空白的设计注册表单/signup将用户重定向到/users/signup.

/login提交空白的设计登录和密码重置表单( to/sessions/user/password/newto /users/secret)时也会发生同样的事情。

我怎样才能/signup再次重定向到?

我的路线文件:

  resources :users

  devise_scope :user do
    get   "login",        :to => "devise/sessions#new"
    get   "logout",       :to => "devise/sessions#destroy"
    get   "signup",       :to => "devise/registrations#new"
    get   "password/new", :to => "devise/passwords#new"
    match 'users/secret',   to: "devise/passwords#create",      via: :post
    match 'sessions/user',  to: 'devise/sessions#create',       via: :post
    match 'users/signup',   to: 'devise/registrations#create',  via: :post

  end

  devise_for :users, :path => '', :path_names => { :sign_in => 'login', :sign_out => 'logout',
                                      :password => 'password', :confirmation => 'verification',
                                      :unlock => 'unblock', :registration => 'signup',
                                      :sign_up => 'new' }

  root 'home#index'
  get  'users/new'

编辑 1

因为没有意义所以删了。

编辑 2

耙路线:

                  Prefix Verb   URI Pattern                  Controller#Action
                   users GET    /users(.:format)             users#index
                         POST   /users(.:format)             users#create
                new_user GET    /users/new(.:format)         users#new
               edit_user GET    /users/:id/edit(.:format)    users#edit
                    user GET    /users/:id(.:format)         users#show
                         PATCH  /users/:id(.:format)         users#update
                         PUT    /users/:id(.:format)         users#update
                         DELETE /users/:id(.:format)         users#destroy
                sessions GET    /sessions(.:format)          sessions#index
                         POST   /sessions(.:format)          sessions#create
             new_session GET    /sessions/new(.:format)      sessions#new
            edit_session GET    /sessions/:id/edit(.:format) sessions#edit
                 session GET    /sessions/:id(.:format)      sessions#show
                         PATCH  /sessions/:id(.:format)      sessions#update
                         PUT    /sessions/:id(.:format)      sessions#update
                         DELETE /sessions/:id(.:format)      sessions#destroy
        new_user_session GET    /login(.:format)             devise/sessions#new
            user_session POST   /login(.:format)             devise/sessions#create
    destroy_user_session DELETE /logout(.:format)            devise/sessions#destroy
           user_password POST   /password(.:format)          devise/passwords#create
       new_user_password GET    /password/new(.:format)      devise/passwords#new
      edit_user_password GET    /password/edit(.:format)     devise/passwords#edit
                         PATCH  /password(.:format)          devise/passwords#update
                         PUT    /password(.:format)          devise/passwords#update
cancel_user_registration GET    /signup/cancel(.:format)     devise/registrations#cancel
       user_registration POST   /signup(.:format)            devise/registrations#create
   new_user_registration GET    /signup/new(.:format)        devise/registrations#new
  edit_user_registration GET    /signup/edit(.:format)       devise/registrations#edit
                         PATCH  /signup(.:format)            devise/registrations#update
                         PUT    /signup(.:format)            devise/registrations#update
                         DELETE /signup(.:format)            devise/registrations#destroy
                   login GET    /login(.:format)             devise/sessions#new
                  logout GET    /logout(.:format)            devise/sessions#destroy
                  signup GET    /signup(.:format)            devise/registrations#new
            password_new GET    /password/new(.:format)      devise/passwords#new
            users_secret POST   /users/secret(.:format)      devise/passwords#create
           sessions_user POST   /sessions/user(.:format)     devise/sessions#create
            users_signup POST   /users/signup(.:format)      devise/registrations#create
                    root GET    /                            home#index
               users_new GET    /users/new(.:format)         users#new
4

1 回答 1

0

您需要修补设计代码并更改在create方法失败时呈现的部分devise/registrationsdevise/passwords', and设计/会话to have it redirect to the respective新的路径为每个。

于 2013-11-03T06:16:38.210 回答