Class: TransactionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- TransactionsController
- Defined in:
- app/controllers/transactions_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /transactions or /transactions.json.
-
#index ⇒ Object
GET /transactions or /transactions.json.
-
#new ⇒ Object
GET /transactions/new.
-
#show ⇒ Object
GET /transactions/1 or /transactions/1.json.
Methods inherited from ApplicationController
#home, #mining_profile, #privacy_policy, #terms
Instance Method Details
#create ⇒ Object
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 |
#index ⇒ Object
GET /transactions or /transactions.json
8 9 10 |
# File 'app/controllers/transactions_controller.rb', line 8 def index @transactions = Transaction.all end |
#new ⇒ Object
GET /transactions/new
17 18 19 |
# File 'app/controllers/transactions_controller.rb', line 17 def new @transaction = Transaction.new end |
#show ⇒ Object
GET /transactions/1 or /transactions/1.json
13 14 |
# File 'app/controllers/transactions_controller.rb', line 13 def show end |