Class: PlaidRails::AccountsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/plaid_rails/accounts_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

create new bank account and return all the accounts for the owner



19
20
21
# File 'app/controllers/plaid_rails/accounts_controller.rb', line 19

def create
  @accounts = PlaidRails::CreateAccountService.call()
end

#destroyObject



27
28
29
30
# File 'app/controllers/plaid_rails/accounts_controller.rb', line 27

def destroy
   = PlaidRails::.find(params[:id])
  .destroy
end

#indexObject



6
7
8
# File 'app/controllers/plaid_rails/accounts_controller.rb', line 6

def index
  @accounts =PlaidRails::.where(owner_id: [:owner_id])
end

#newObject

display list of accounts for authenticated user



11
12
13
14
15
16
# File 'app/controllers/plaid_rails/accounts_controller.rb', line 11

def new
  @user = Plaid.set_user([:access_token], ['auth'])
  # Retrieve the user's accounts
  @user.get('auth')
  @accounts = @user.accounts
end

#updateObject



23
24
25
# File 'app/controllers/plaid_rails/accounts_controller.rb', line 23

def update
  
end