Class: CartsController

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

Constant Summary collapse

CLOSED_CART_LIMIT =
10

Instance Method Summary collapse

Instance Method Details

#archiveObject


16
17
18
19
# File 'app/controllers/carts_controller.rb', line 16

def archive
  @role = params[:role] || 'requester'
  @closed_cart_full_list = current_user.carts.where(approvals: {role: @role}).closed.order('created_at DESC')
end

#indexObject


11
12
13
14
# File 'app/controllers/carts_controller.rb', line 11

def index  # TODO: include action buttons for approvers

  @carts = current_user.carts.order('created_at DESC')
end

#showObject


5
6
7
8
9
# File 'app/controllers/carts_controller.rb', line 5

def show
  cart = Cart.find params[:id]
  @cart = cart.decorate
  @show_comments = true
end