Class: OrdersController

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

Overview

rubocop:todo Style/Documentation

Constant Summary

Constants included from FlashTruncation

FlashTruncation::STRING_OVERHEAD

Instance Method Summary collapse

Methods inherited from ApplicationController

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

Methods included from FlashTruncation

#max_flash_size, #truncate_flash, #truncate_flash_array

Instance Method Details

#destroyObject


2
3
4
5
6
7
8
# File 'app/controllers/orders_controller.rb', line 2

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

#updateObject


10
11
12
13
14
15
# File 'app/controllers/orders_controller.rb', line 10

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

  redirect_to @order.submission
end