Method: ActionDispatch::Routing::Mapper#with_devise_exclusive_scope
- Defined in:
- lib/devise/rails/routes.rb
#with_devise_exclusive_scope(new_path, new_as, options) ⇒ Object (protected)
:nodoc:
460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 |
# File 'lib/devise/rails/routes.rb', line 460 def with_devise_exclusive_scope(new_path, new_as, ) #:nodoc: current_scope = @scope.dup exclusive = { as: new_as, path: new_path, module: nil } exclusive.merge!(.slice(:constraints, :format, :defaults, :options)) if @scope.respond_to? :new @scope = @scope.new exclusive else exclusive.each_pair { |key, value| @scope[key] = value } end yield ensure @scope = current_scope end |