Class: OrdersController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#block_api_access, #clean_params_from_check, #evil_parameter_hack!, #extract_header_info, #set_cache_disabled!

Instance Method Details

#destroyObject


5
6
7
8
9
10
11
# File 'app/controllers/orders_controller.rb', line 5

def destroy
  # Check for ajax request...
  if request.xhr?
    Order.find(params[:id]).destroy
    head :accepted
  end
end

#updateObject


13
14
15
16
17
18
# File 'app/controllers/orders_controller.rb', line 13

def update
  @order = Order.find(params[:id])
  @order.add_comment(params[:comments], current_user) unless params[:comments].nil?

  redirect_to @order.submission
end