Class: Atreides::AdminController

Inherits:
ApplicationController show all
Defined in:
app/controllers/atreides/admin_controller.rb

Class Method Summary collapse

Class Method Details

.inherited(base) ⇒ Object



4
5
6
7
8
9
# File 'app/controllers/atreides/admin_controller.rb', line 4

def self.inherited(base)
  super
  resource_class_name = base.name.sub(/Admin::/, '').sub(/Controller/, '').singularize
  base.resource_class = resource_class_name.constantize
  base.resources_configuration[:self][:request_name] = base.resource_class.to_s.sub(/Atreides::/, '').underscore.gsub('/', '_')
end