Class: AccountsController

Inherits:
ApplicationController show all
Defined in:
lib/templates/controllers/accounts_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_account

Instance Method Details

#send_user_inviteObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/templates/controllers/accounts_controller.rb', line 8

def send_user_invite
  email = params[:user][:email]

  if User.only_deleted.where(email: email).any?
    user = User.only_deleted.where(email: email).first
    if user.deleted_at
      user.restore
      user.update(account: )
      user.invite!(user)
    end
  else
    User.invite!(email: email, account: )
  end

  respond_to do |format|
    format.html { redirect_to , notice: 'Invite sent successfully' }
  end
end

#usersObject



4
5
6
# File 'lib/templates/controllers/accounts_controller.rb', line 4

def users
  @users = .users.all
end