diff --git a/app/models/user.rb b/app/models/user.rb index 81d3d2d9c..cd129255c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -2,7 +2,7 @@ class User < ApplicationRecord # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :recoverable, :rememberable, :validatable, - :trackable + :trackable, :registerable belongs_to :organisation has_many :owned_case_logs, through: :organisation diff --git a/config/routes.rb b/config/routes.rb index 405af1b31..58b026950 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,15 +1,17 @@ Rails.application.routes.draw do devise_for :admin_users, ActiveAdmin::Devise.config - devise_for :users, controllers: { passwords: "users/passwords", sessions: "users/sessions" }, skip: [:registrations] + devise_for :users, controllers: { + passwords: "users/passwords", + sessions: "users/sessions", + registrations: "users/registrations" + } + devise_scope :user do get "user", to: "users/account#index" get "users", to: "users/account#index" - get "users/new", to: "devise/registrations#new", as: "new_user_registration" - get "users/edit", to: "devise/registrations#edit", as: "edit_user_registration" get "users/account", to: "users/account#index" get "confirmations/reset", to: "users/passwords#reset_confirmation" get "users/account/personal_details", to: "users/account#edit" - patch "users", to: "users/registrations#update", as: "user_registration" patch "details", to: "users/account#update", as: "account_update" end