I am writing a Rails app that I partially inherited. There is a snippet of code in the routes.rb that I'm trying to puzzle out and can't find anything in the documentation.
authenticate :users do
resources :authentications
end
What does this do and why is it needed here? I'd never seen the authenticate
used in this context bef开发者_C百科ore. There are resources called users and authentications in the file, and I am using Devise+OmniAuth for authentication.
As seen here in the Devise Docs, it allows you to add authentication at the router level rather than at the application level(aka controllers, essentially).
精彩评论