Resque, Devise and admin authentication

后端 未结 4 1359
生来不讨喜
生来不讨喜 2020-12-08 00:48

Using Resque and Devise, i have roles for User, like:

User.first.role #=> admin
User.last.role #=> regular

I want to setup an authent

4条回答
  •  情歌与酒
    2020-12-08 01:18

    There is always the new solution, type this in your routes.rb for rails > 3.1:

      authenticate :admin do
        mount Resque::Server.new, :at => "/resque"
      end
    

    And don't forget:

    devise_for :admins
    

提交回复
热议问题