Skip to content

How To: Define a different root route for logged out users

Lucas Braun edited this page Aug 26, 2019 · 2 revisions

This works in Rails 5.1+

Rails.application.routes.draw do
  devise_for :users

  authenticated :user do
    root 'secret#index', as: :authenticated_root
  end

  root "home#index"
end

Clone this wiki locally