Sha256: 3ac51934964b2d705e106ef5a839abda02074b853b761e14ff8772cf57fd7805
Contents?: true
Size: 1.09 KB
Versions: 4
Compression:
Stored size: 1.09 KB
Contents
require_dependency "plaid_rails/application_controller" module PlaidRails class AccountsController < ApplicationController def index @plaid_accounts =PlaidRails::Account.where(owner_id: account_params[:owner_id]) end # display list of accounts for authenticated user def new account_params["access_token"] @user = Plaid::User.load(:connect, account_params["access_token"]) @user.transactions @plaid_accounts = @user.accounts end #create new bank account and return all the accounts for the owner def create @plaid_accounts = PlaidRails::CreateAccountService.call(account_params) end def update end def destroy @plaid_account = PlaidRails::Account.find(params[:id]) @plaid_account.destroy end private # Never trust parameters from the scary internet, only allow the white list through. def account_params params.require(:account).permit(:token,:access_token, :type,:name, :owner_id,:owner_type, :transactions_start_date, account_ids:[]) end end end
Version data entries
4 entries across 4 versions & 1 rubygems