2017-11-16 4 views
1
Rails 5.1 
Devise 

マイroutes.rbをファイル:欠落工夫ルート

Rails.application.routes.draw do 

    # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html 
    devise_for :users, controllers: { 
     sessions: 'users/sessions', 
     confirmations: 'users/confirmations', 
     passwords: 'users/passwords', 
     registrations: 'users/registrations', 
     unlocks: 'users/unlocks', 
     invitations: 'users/invitations' 
    } 

    root to: "landings#index" 
    resources :users 
    resources :followeds 
    resources :followers 
    resources :locations 
    resources :fw_exports 

    get 'import_spreadsheet', to: :upload_spreadsheet, controller: 'fw_exports' 
    post 'parse_imported_spreadsheet_and_confirm', to: :process_imported_spreadsheet_and_confirm, controller: 'fw_exports' 
    post 'process_parsed_spreadsheet', to: :process_parsed_spreadsheet, controller: 'fw_exports' 

    scope module: :landings do 
    get 'visitors' 
    end 

end 

私はルートを生成すると、ここで私が得るものです:

      Prefix Verb URI Pattern          Controller#Action 
        new_user_session GET /users/sign_in(.:format)       users/sessions#new 
         user_session POST /users/sign_in(.:format)       users/sessions#create 
       destroy_user_session DELETE /users/sign_out(.:format)       users/sessions#destroy 
       new_user_password GET /users/password/new(.:format)      users/passwords#new 
       edit_user_password GET /users/password/edit(.:format)     users/passwords#edit 
        user_password PATCH /users/password(.:format)       users/passwords#update 
            PUT /users/password(.:format)       users/passwords#update 
            POST /users/password(.:format)       users/passwords#create 
      cancel_user_registration GET /users/cancel(.:format)       users/registrations#cancel 
      new_user_registration GET /users/sign_up(.:format)       users/registrations#new 
      edit_user_registration GET /users/edit(.:format)        users/registrations#edit 
       user_registration PATCH /users(.:format)         users/registrations#update 
            PUT /users(.:format)         users/registrations#update 
            DELETE /users(.:format)         users/registrations#destroy 
            POST /users(.:format)         users/registrations#create 
      accept_user_invitation GET /users/invitation/accept(.:format)    users/invitations#edit 
      remove_user_invitation GET /users/invitation/remove(.:format)    users/invitations#destroy 
       new_user_invitation GET /users/invitation/new(.:format)     users/invitations#new 
        user_invitation PATCH /users/invitation(.:format)      users/invitations#update 
            PUT /users/invitation(.:format)      users/invitations#update 
            POST /users/invitation(.:format)      users/invitations#create 
           root GET /            landings#index 
          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 
         followeds GET /followeds(.:format)        followeds#index 
            POST /followeds(.:format)        followeds#create 
         new_followed GET /followeds/new(.:format)       followeds#new 
        edit_followed GET /followeds/:id/edit(.:format)      followeds#edit 
          followed GET /followeds/:id(.:format)       followeds#show 
            PATCH /followeds/:id(.:format)       followeds#update 
            PUT /followeds/:id(.:format)       followeds#update 
            DELETE /followeds/:id(.:format)       followeds#destroy 
         followers GET /followers(.:format)        followers#index 
            POST /followers(.:format)        followers#create 
         new_follower GET /followers/new(.:format)       followers#new 
        edit_follower GET /followers/:id/edit(.:format)      followers#edit 
          follower GET /followers/:id(.:format)       followers#show 
            PATCH /followers/:id(.:format)       followers#update 
            PUT /followers/:id(.:format)       followers#update 
            DELETE /followers/:id(.:format)       followers#destroy 
         locations GET /locations(.:format)        locations#index 
            POST /locations(.:format)        locations#create 
         new_location GET /locations/new(.:format)       locations#new 
        edit_location GET /locations/:id/edit(.:format)      locations#edit 
          location GET /locations/:id(.:format)       locations#show 
            PATCH /locations/:id(.:format)       locations#update 
            PUT /locations/:id(.:format)       locations#update 
            DELETE /locations/:id(.:format)       locations#destroy 
         fw_exports GET /fw_exports(.:format)        fw_exports#index 
            POST /fw_exports(.:format)        fw_exports#create 
        new_fw_export GET /fw_exports/new(.:format)       fw_exports#new 
        edit_fw_export GET /fw_exports/:id/edit(.:format)     fw_exports#edit 
         fw_export GET /fw_exports/:id(.:format)       fw_exports#show 
            PATCH /fw_exports/:id(.:format)       fw_exports#update 
            PUT /fw_exports/:id(.:format)       fw_exports#update 
            DELETE /fw_exports/:id(.:format)       fw_exports#destroy 
       import_spreadsheet GET /import_spreadsheet(.:format)      fw_exports#import_spreadsheet 
parse_imported_spreadsheet_and_confirm POST /parse_imported_spreadsheet_and_confirm(.:format) fw_exports#parse_imported_spreadsheet_and_confirm 
     process_parsed_spreadsheet POST /process_parsed_spreadsheet(.:format)    fw_exports#process_parsed_spreadsheet 
          visitors GET /visitors(.:format)        landings#visitors 

は私がいないにもconfirmatinsのルートを取得することになっていますそしてロックを解除する?

+1

私はあなたとほぼ同じ設定をしていますが、私はレーキルートを実行しても同じ動作をしますが、ルートは実際に動作しています。 – DivXZero

+1

あなたはここの残りの手順を踏んだことがありますか?:https://github.com/plataformatec/devise/wiki/How-To:-Add-:confirmable-to-Users – Trinculo

+0

私はコメントしませんでした:cofirmable、 :user.rbでロック可能、私はやった、今、私はルートを見ることができます – EastsideDeveloper

答えて

0

問題は、ロック可能 & 確認できるをコメントしています。それを機能させるには、コメントを外す必要があります。

class User < ApplicationRecord 
    # Include default devise modules. Others available are: 
    # :timeoutable and :omniauthable 
    devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :confirmable, :lockable 
end