Method: Kangaru::Controller.path

Defined in:
lib/kangaru/controller.rb

.pathObject

Returns the partial path for the controller based on the class name. The first module namespace is removed as this is either Kangaru or the target gem namespace. Used to infer the location of view files.



24
25
26
# File 'lib/kangaru/controller.rb', line 24

def self.path
  name&.delete_suffix(SUFFIX)&.gsub(/^.*?::/, "")&.to_snakecase || raise
end