Try a different method of stopping sign_ups
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
class RegistrationsController < Devise::RegistrationsController
|
||||
|
||||
before_action :one_user_registered?, only: [:new, :create]
|
||||
before_action :one_user_registered, only: [:new, :create]
|
||||
|
||||
protected
|
||||
|
||||
def one_user_registered?
|
||||
def one_user_registered
|
||||
if User.count == 1
|
||||
if user_signed_in?
|
||||
redirect_to root_path
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<li><%= link_to "Edit account", edit_user_registration_path %></li>
|
||||
<li><%= button_to "Log out", destroy_user_session_path, method: :delete %></li><% end %>
|
||||
</menu>
|
||||
<br/>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user