Class: PlaidRails::AccountsController
- Inherits:
- 
      ApplicationController
      
        - Object
- ActionController::Base
- ApplicationController
- PlaidRails::AccountsController
 
- Defined in:
- app/controllers/plaid_rails/accounts_controller.rb
Instance Method Summary collapse
- 
  
    
      #create  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    create new bank account and return all the accounts for the owner. 
- #destroy ⇒ Object
- #index ⇒ Object
- 
  
    
      #new  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    display list of accounts for authenticated user. 
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
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 @plaid_accounts = PlaidRails::CreateAccountService.call(account_params) end | 
#destroy ⇒ Object
| 27 28 29 30 | # File 'app/controllers/plaid_rails/accounts_controller.rb', line 27 def destroy @plaid_account = PlaidRails::Account.find(params[:id]) @plaid_account.destroy end | 
#index ⇒ Object
| 6 7 8 | # File 'app/controllers/plaid_rails/accounts_controller.rb', line 6 def index @plaid_accounts =PlaidRails::Account.where(owner_id: account_params[:owner_id]) end | 
#new ⇒ Object
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 account_params["access_token"] @user = Plaid::User.load(:connect, account_params["access_token"]) @user.transactions @plaid_accounts = @user.accounts end | 
#update ⇒ Object
| 23 24 25 | # File 'app/controllers/plaid_rails/accounts_controller.rb', line 23 def update end |