Class: Customs::ControllerResource

Inherits:
CanCan::ControllerResource
  • Object
show all
Defined in:
lib/customs/control_traffic.rb

Overview

Override CanCan::ControllerResource

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ ControllerResource

Returns a new instance of ControllerResource.



8
9
10
11
12
# File 'lib/customs/control_traffic.rb', line 8

def initialize *args
  super
  @controller.resource_name   = instance_name
  @controller.resource_class  = resource_class
end

Instance Method Details

#build_resourceObject



14
15
16
17
# File 'lib/customs/control_traffic.rb', line 14

def build_resource
  resource = resource_base.new
  assign_attributes(resource)
end