module Padrino::ControllerNamespacing

Public Instance Methods

controllers_with_namespaces(*args, &block) click to toggle source

Makes the routes defined in the block and in the Modules given in `extensions` available to the application

# File lib/padrino-routing/controller_ext.rb, line 6
def controllers_with_namespaces(*args, &block)
  return controllers_without_namespaces(*args, &block) unless args.all? { |a| a.kind_of?(Symbol) }
  namespace(*args) { instance_eval(&block) } if block_given?
end
urls(*extensions, &block) click to toggle source

Makes the routing urls defined in this block and in the Modules given in `extensions` available to the application

# File lib/padrino-routing/controller_ext.rb, line 13
def urls(*extensions, &block)
  instance_eval(&block) if block_given?
  include(*extensions)  if extensions.any?
end