Method: Jets::Router::Dsl#scope
- Defined in:
- lib/jets/router/dsl.rb
#scope(*args) ⇒ Object
Examples
scope :admin
scope path: :admin
scope 'admin', as: 'admin'
82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/jets/router/dsl.rb', line 82 def scope(*args) = args. path = args.first [:path] = path.to_s if path root_level = @scope.nil? @scope = root_level ? Scope.new() : @scope.new() yield ensure @scope = @scope.parent if @scope end |