Class: OrdersController
Instance Method Summary
collapse
#get_login_link, #set_locale_with_config
Instance Method Details
#index ⇒ Object
5
6
7
|
# File 'app/controllers/orders_controller.rb', line 5
def index
@orders = current_user.orders(:conditions => {:status => ['paid', 'shipped']}, :order => :updated_at).paginate(:page => page, :per_page => per_page)
end
|
#show ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'app/controllers/orders_controller.rb', line 9
def show
@order = Order.first(:conditions => {:id => params[:id], :status => ['paid', 'shipped']})
if not @order
flash[:error] = t(:not_found, :scope => :order)
return render :text => '', :status => 404
elsif current_user.id != @order.user_id
flash[:error] = t(:not_authorized)
return render :text => '', :status => 401
end
end
|