Method: ActionDispatch::Routing::Mapper#unauthenticated
- Defined in:
- lib/devise/rails/routes.rb
#unauthenticated(scope = nil) ⇒ Object
Allow you to route based on whether a scope is not authenticated. You can optionally specify which scope.
unauthenticated do
as :user do
root to: 'devise/registrations#new'
end
end
root to: 'dashboard#show'
330 331 332 333 334 335 336 337 338 |
# File 'lib/devise/rails/routes.rb', line 330 def unauthenticated(scope = nil) constraint = lambda do |request| not request.env["warden"].authenticate? scope: scope end constraints(constraint) do yield end end |