Module: Narrator::ControllerAdditions::ClassMethods

Defined in:
lib/narrator/controller_additions.rb

Instance Method Summary collapse

Instance Method Details

#narrate_resource(*args) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/narrator/controller_additions.rb', line 5

def narrate_resource(*args)
  narrator_resource_class.add_after_filter(
    self,
    :narrate_resource,
    *args
  )
end

#narrator_resource_classObject



13
14
15
16
17
18
19
# File 'lib/narrator/controller_additions.rb', line 13

def narrator_resource_class
  if ancestors.map(&:to_s).include? 'InheritedResources::Actions'
    InheritedResource
  else
    ControllerResource
  end
end