Sha256: 91df7f7bf835542eaf420ad0b3f39510aacf5d840d924822d15f15a9c3c5d16b

Contents?: true

Size: 1.15 KB

Versions: 7

Compression:

Stored size: 1.15 KB

Contents

require 'ransack' if Itsf::Backend.features?(:ransack)
require 'kaminari' if Itsf::Backend.features?(:kaminari)

module Itsf::Backend
  class Resource::BaseController < Configuration.resource_base_controller.constantize
    if Itsf::Backend.features?(:pundit)
      include Controller::RestActionsConcernWithPundit
      include Pundit
      prepend Controller::PunditNamespacedAuthorizeConcern
      helper_method :engine_policy
    else
      include Controller::RestActionsConcern
    end
    include Controller::ResourceUrlsConcern
    include Controller::ResourceInflectionsConcern
    include Controller::RansackConcern if Itsf::Backend.features?(:ransack)
    include Controller::PaginationConcern if Itsf::Backend.features?(:kaminari)
    include Controller::JsonApiConcern
    helper Itsf::Backend::ApplicationHelper
    helper MultiClientHelper if Itsf::Backend.features?(:multi_client)
    
    helper_method :resource_class

    helper ResourceRenderer::ViewHelper

    layout 'itsf/backend/base'

    def self.resource_class
      name.gsub('Controller', '').singularize.constantize
    end

    def resource_class
      self.class.resource_class
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
itsf_backend-1.1.6 app/controllers/itsf/backend/resource/base_controller.rb
itsf_backend-1.1.5 app/controllers/itsf/backend/resource/base_controller.rb
itsf_backend-1.1.4 app/controllers/itsf/backend/resource/base_controller.rb
itsf_backend-1.1.3 app/controllers/itsf/backend/resource/base_controller.rb
itsf_backend-1.1.2 app/controllers/itsf/backend/resource/base_controller.rb
itsf_backend-1.1.1 app/controllers/itsf/backend/resource/base_controller.rb
itsf_backend-1.1.0 app/controllers/itsf/backend/resource/base_controller.rb