Class: TransactionsController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#home, #mining_profile, #privacy_policy, #terms

Instance Method Details

#createObject

POST /transactions or /transactions.json



22
23
24
25
26
27
28
# File 'app/controllers/transactions_controller.rb', line 22

def create
  @receiver_key = transaction_params[:receiver_key]
  @amount = transaction_params[:amount]
  @sender_key = Wallet.find_by(user_id: current_user.id).pv_key
  create_transaction_in_block
  redirect_to transactions_path, notice: "Processing transaction, please wait a minute and refresh the page"
end

#indexObject

GET /transactions or /transactions.json



8
9
10
# File 'app/controllers/transactions_controller.rb', line 8

def index
  @transactions = Transaction.all
end

#newObject

GET /transactions/new



17
18
19
# File 'app/controllers/transactions_controller.rb', line 17

def new
  @transaction = Transaction.new
end

#showObject

GET /transactions/1 or /transactions/1.json



13
14
# File 'app/controllers/transactions_controller.rb', line 13

def show
end