Class: Spree::Admin::PostageLabelsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/spree/admin/postage_labels_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/spree/admin/postage_labels_controller.rb', line 6

def show
  @shipment = Spree::Shipment.find_by(number: params[:shipment_id])
  authorize! @shipment, :show

  unless @shipment.easypost_postage_label_url
    flash[:error] = t('.no_postage_label', shipment_number: @shipment.number)
    redirect_back(fallback_location: edit_admin_order_path(@shipment.order))
    return
  end

  redirect_to @shipment.easypost_postage_label_url
end