开发者

Puzzling over my routes.rb file

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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜