Sha256: 6f314e802cd770717363dce3874276e2f837326c93334200ee05ab791d52519d

Contents?: true

Size: 670 Bytes

Versions: 8

Compression:

Stored size: 670 Bytes

Contents

module Spree
  module Admin
    module Orders
      class DeliveryOptionsController < Spree::Admin::BaseController

        def edit
          @order = Order.find_by(number: params[:order_id])
        end

        def update
          @order = Order.find_by(number: params[:order_id])
          if @order.update_attributes(delivery_options_params) && @order.next
            flash[:success] = Spree.t('delivery_options_updated')
          end

          render :edit
        end

        private

        def delivery_options_params
          params.require(:order).permit(:delivery_date, :delivery_time, :delivery_instructions)
        end

      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
spree_delivery_options-2.2.2 app/controllers/spree/admin/orders/delivery_options_controller.rb
spree_delivery_options-2.2.1 app/controllers/spree/admin/orders/delivery_options_controller.rb
spree_delivery_options-2.2.0 app/controllers/spree/admin/orders/delivery_options_controller.rb
spree_delivery_options-2.1.15 app/controllers/spree/admin/orders/delivery_options_controller.rb
spree_delivery_options-2.1.14 app/controllers/spree/admin/orders/delivery_options_controller.rb
spree_delivery_options-2.1.13 app/controllers/spree/admin/orders/delivery_options_controller.rb
spree_delivery_options-2.1.12 app/controllers/spree/admin/orders/delivery_options_controller.rb
spree_delivery_options-2.1.11 app/controllers/spree/admin/orders/delivery_options_controller.rb