Class: Admin::ResourceController

Inherits:
ApplicationController
  • Object
show all
Extended by:
Radiant::ResourceResponses
Defined in:
app/controllers/admin/resource_controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Radiant::ResourceResponses

extended, responses

Class Method Details

.model_class(model_class = nil) ⇒ Object



10
11
12
# File 'app/controllers/admin/resource_controller.rb', line 10

def self.model_class(model_class = nil)
  @model_class ||= (model_class || self.controller_name).to_s.singularize.camelize.constantize
end

Instance Method Details

#destroyObject



65
66
67
68
# File 'app/controllers/admin/resource_controller.rb', line 65

def destroy
  model.destroy
  response_for :destroy
end

#indexObject



44
45
46
# File 'app/controllers/admin/resource_controller.rb', line 44

def index
  response_for :plural
end