Class: OrdersController

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

Constant Summary

Constants included from FlashTruncation

FlashTruncation::STRING_OVERHEAD

Instance Method Summary collapse

Methods inherited from ApplicationController

#block_api_access, #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



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

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

#updateObject



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

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

  redirect_to @order.submission
end