Skip to content

Commit

Permalink
Disable registrations
Browse files Browse the repository at this point in the history
  • Loading branch information
odinsride committed Dec 13, 2022
1 parent 27b81d5 commit aa6fdfe
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,4 @@ modules.xml
.idea/codestream.xml

# End of https://www.toptal.com/developers/gitignore/api/rubymine
.yarn/*
/.yarn
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class User < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
devise :database_authenticatable,
:recoverable, :rememberable, :trackable, :validatable, :confirmable

# validates :password_confirmation, presence: true
Expand Down
4 changes: 2 additions & 2 deletions app/views/devise/registrations/components/_formEdit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<h3 class="title is-4 has-text-link">Account Settings</h3>

<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= form_for(resource, as: resource_name, url: user_registration_path(resource_name)) do |f| %>

<div class="columns">
<!-- Fields -->
Expand Down Expand Up @@ -121,7 +121,7 @@

<!-- CHECK THIS OUT: https://gorails.com/forum/how-do-i-separate-out-the-devise-form-like-gorails-com-edit-profile-edit-password -->
<h3 class="title is-4 has-text-link">Change Password</h3>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= form_for(resource, as: resource_name, url: user_registration_path(resource_name)) do |f| %>

<div class="columns">
<!-- Fields -->
Expand Down
7 changes: 0 additions & 7 deletions app/views/shared/_guestlinks.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
<%= link_to new_user_registration_path, class: "button is-link is-outlined" do %>
<span class="icon is-small">
<i class="fas fa-user-plus"></i>
</span>
<span>Sign up</span>
<% end %>
<%= link_to new_user_session_path, class: "button is-link" do %>
<span class="icon">
<i class="fas fa-sign-in-alt"></i>
Expand Down
7 changes: 0 additions & 7 deletions app/views/static_pages/home.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@
A personal finance tool designed to help balance and reconcile your accounts.
</p>
<p class="has-text-centered">
<%= link_to new_user_registration_path, class: "button is-white has-text-link" do %>
<span class="icon is-small">
<i class="fas fa-user-plus"></i>
</span>
<span>Sign up</span>
<% end %>
<%= link_to new_user_session_path, class: "button is-white has-text-link" do %>
<span class="icon">
<i class="fas fa-sign-in-alt"></i>
Expand Down
11 changes: 10 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
# frozen_string_literal: true

Rails.application.routes.draw do
devise_for :users, controllers: { registrations: 'registrations' }
devise_scope :user do
get "/sign_in" => "devise/sessions#new"
end

devise_for :users, :skip => [:registrations], controllers: { registrations: 'registrations' }

as :user do
get "users/edit" => "devise/registrations#edit", :as => "edit_user_registration"
patch "users/:id" => "devise/registrations#update", :as => "user_registration"
end

get 'accounts/inactive' => 'accounts#inactive'
get 'accounts/summary' => 'summary#index'
Expand Down

0 comments on commit aa6fdfe

Please sign in to comment.