Sha256: 18e4ef0b33d4e60b21489b0ca8bd6937464488ee933087fc47c43bae6b5a32dc

Contents?: true

Size: 1017 Bytes

Versions: 63

Compression:

Stored size: 1017 Bytes

Contents

module Spree
  module Admin
    class ReimbursementTypesController < ResourceController
      def update
        invoke_callbacks(:update, :before)
        if @object.update_attributes(permitted_resource_params_for_update)
          invoke_callbacks(:update, :after)
          respond_with(@object) do |format|
            format.html do
              flash[:success] = flash_message_for(@object, :successfully_updated)
              redirect_to location_after_save
            end
            format.js { render layout: false }
          end
        else
          invoke_callbacks(:update, :fails)
          respond_with(@object) do |format|
            format.html { render action: :edit }
            format.js { render layout: false }
          end
        end
      end

      private

      def permitted_resource_params_for_update
        params_hash = @object.type.underscore.remove('spree/').tr('/', '_')
        params.require(params_hash.to_s).permit(:name, :active, :mutable)
      end
    end
  end
end

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
spree_backend-3.7.14.1 app/controllers/spree/admin/reimbursement_types_controller.rb
spree_backend-3.7.14 app/controllers/spree/admin/reimbursement_types_controller.rb
spree_backend-3.7.13 app/controllers/spree/admin/reimbursement_types_controller.rb
spree_backend-3.7.12 app/controllers/spree/admin/reimbursement_types_controller.rb
spree_backend-3.7.11 app/controllers/spree/admin/reimbursement_types_controller.rb
spree_backend-3.4.6 app/controllers/spree/admin/reimbursement_types_controller.rb
spree_backend-3.7.10 app/controllers/spree/admin/reimbursement_types_controller.rb
spree_backend-3.7.9 app/controllers/spree/admin/reimbursement_types_controller.rb
spree_backend-3.7.8 app/controllers/spree/admin/reimbursement_types_controller.rb
spree_backend-3.7.7 app/controllers/spree/admin/reimbursement_types_controller.rb
spree_backend-3.7.6 app/controllers/spree/admin/reimbursement_types_controller.rb
spree_backend-3.7.5 app/controllers/spree/admin/reimbursement_types_controller.rb
spree_backend-3.7.4 app/controllers/spree/admin/reimbursement_types_controller.rb
spree_backend-3.7.3 app/controllers/spree/admin/reimbursement_types_controller.rb
spree_backend-3.7.2 app/controllers/spree/admin/reimbursement_types_controller.rb
spree_backend-3.7.1 app/controllers/spree/admin/reimbursement_types_controller.rb
spree_backend-3.7.0 app/controllers/spree/admin/reimbursement_types_controller.rb
spree_backend-3.7.0.rc3 app/controllers/spree/admin/reimbursement_types_controller.rb
spree_backend-3.2.9 app/controllers/spree/admin/reimbursement_types_controller.rb
spree_backend-3.7.0.rc2 app/controllers/spree/admin/reimbursement_types_controller.rb