Sha256: 22ea78eb89c20813bbf3d8bc442093bfcd88587f95211615c81c017230d4c11c

Contents?: true

Size: 987 Bytes

Versions: 28

Compression:

Stored size: 987 Bytes

Contents

require 'spree/api/responders'

module Spree
  module Api
    module ControllerSetup
      def self.included(klass)
        klass.class_eval do
          include AbstractController::Rendering
          include AbstractController::ViewPaths
          include AbstractController::Callbacks
          include AbstractController::Helpers

          include ActiveSupport::Rescuable

          include ActionController::Rendering
          include ActionController::ImplicitRender
          include ActionController::Rescue
          include ActionController::MimeResponds
          include ActionController::Head

          include CanCan::ControllerAdditions
          include Spree::Core::ControllerHelpers::Auth

          prepend_view_path Rails.root + "app/views"
          append_view_path File.expand_path("../../../app/views", File.dirname(__FILE__))

          self.responder = Spree::Api::Responders::AppResponder
          respond_to :json
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
spree_api-2.1.12 lib/spree/api/controller_setup.rb
spree_api-2.1.11 lib/spree/api/controller_setup.rb
spree_api-2.1.10 lib/spree/api/controller_setup.rb
spree_api-2.0.13 lib/spree/api/controller_setup.rb
spree_api-2.1.9 lib/spree/api/controller_setup.rb
spree_api-2.1.8 lib/spree/api/controller_setup.rb
spree_api-2.0.12 lib/spree/api/controller_setup.rb
spree_api-2.1.7 lib/spree/api/controller_setup.rb
spree_api-2.0.11 lib/spree/api/controller_setup.rb
spree_api-2.0.10 lib/spree/api/controller_setup.rb
spree_api-2.1.6 lib/spree/api/controller_setup.rb
spree_api-2.1.5 lib/spree/api/controller_setup.rb
spree_api-2.0.9 lib/spree/api/controller_setup.rb
spree_api-2.1.4 lib/spree/api/controller_setup.rb
spree_api-2.0.8 lib/spree/api/controller_setup.rb
spree_api-2.1.3 lib/spree/api/controller_setup.rb
spree_api-2.0.7 lib/spree/api/controller_setup.rb
spree_api-2.1.2 lib/spree/api/controller_setup.rb
spree_api-2.0.6 lib/spree/api/controller_setup.rb
spree_api-2.1.1 lib/spree/api/controller_setup.rb