Devise logged in root route rails 3

前端 未结 5 1237
遥遥无期
遥遥无期 2020-12-07 12:28

Heyya guys. So i thought about this coolio idea, if you are logged in then you get some sort of dashboard, else you get an information/login/sign up page..

5条回答
  •  长情又很酷
    2020-12-07 12:47

    I have the same problem and I solved it with this:

    authenticated :user do
      root :to => "wathever#index"
    end
    unauthenticated :user do
      devise_scope :user do 
        get "/" => "devise/sessions#new"
      end
    end
    

    Hope it helps.

提交回复
热议问题