私の質問ではHow to have root view when user is not logged in rails?は、authenticated
を使用して、誰かが認証された場合にのみルートを利用できるようにすると答えています。私はどのように私はこれを構造化することができprobemを持っています:Deviseを使用して認証されたルートを構成する方法は?
Rails.application.routes.draw do
devise_for :users
authenticated :user do
# when authenticated allow all action on student
resources :subjects do
resources :students
end
end
# when not only allow read on student
resources :subjects do
resources :students, only: [:get]
end
root "home#index"
end
問題は、私はそれを停止する方法:subjects
上の任意の認証されていないアクションを許可したくないのですか?