Class: Resource::BaseController

Inherits:
Object
  • Object
show all
Includes:
Controller::CollectionLinksConcern, Controller::FeatureFlagsConcern, Controller::JsonApiConcern, Controller::PaginationConcern, Controller::PunditAuthorizationFailureHandlingConcern, Controller::PunditNamespacedAuthorizeConcern, Controller::RansackConcern, Controller::ResourceInflectionsConcern, Controller::ResourceLinksConcern, Controller::ResourceUrlsConcern, Controller::RestActionsConcern, Controller::RestActionsConcernWithPundit, Pundit
Defined in:
app/controllers/itsf/backend/resource/base_controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Controller::RestActionsConcernWithPundit

#create, #destroy, #edit, #index, #new, #show, #update

Methods included from Controller::PunditNamespacedAuthorizeConcern

#authorize, #engine_policy

Class Method Details

.resource_classObject



33
34
35
# File 'app/controllers/itsf/backend/resource/base_controller.rb', line 33

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

.resource_countObject



37
38
39
# File 'app/controllers/itsf/backend/resource/base_controller.rb', line 37

def self.resource_count
  resource_class.count
end

Instance Method Details

#resource_classObject



41
42
43
# File 'app/controllers/itsf/backend/resource/base_controller.rb', line 41

def resource_class
  self.class.resource_class
end