Class: TerminalOrdersController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#authenticate_terminal

Instance Method Details

#acknowledgeObject



4
5
6
7
8
9
10
11
12
13
# File 'app/controllers/terminal_orders_controller.rb', line 4

def acknowledge
  order = @terminal.terminal_orders.find_by_id(params[:id])

  if order.blank?
    render :text => nil, :status => 404
  else
    order.sent!(params[:percent], params[:error])
    render :text => nil, :status => 200
  end
end

#completeObject



15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/terminal_orders_controller.rb', line 15

def complete
  order = @terminal.terminal_orders.find_by_id(params[:id])

  if order.blank?
    render :text => nil, :status => 404
  else
    order.complete!
    render :text => nil, :status => 200
  end
end