Skip to content
This repository
tree: e88303a506
Fetching contributors…

Cannot retrieve contributors at this time

file 27 lines (24 sloc) 0.78 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
class Admin::WeightBasedShippingRatesController < Admin::AppController
  prepend_before_filter :authenticate_user!
  layout 'admin'
  expose(:shop){ current_user.shop }
  expose(:shippings) { shop.shippings }
  expose(:shipping)
  expose(:weight_based_shipping_rates) { shipping.weight_based_shipping_rates }
  expose(:weight_based_shipping_rate)

  def create
    weight_based_shipping_rate.save
    render json: weight_based_shipping_rate
  end

  def destroy
    weight_based_shipping_rate.destroy
    render json: weight_based_shipping_rate
  end

  def update
    if weight_based_shipping_rate.save
      redirect_to edit_shipping_weight_based_shipping_rate_path(shipping, weight_based_shipping_rate),notice: notice_msg
    else
      render action: 'edit'
    end
  end
end
Something went wrong with that request. Please try again.