Rails devise Sessions Controller

后端 未结 1 1972
逝去的感伤
逝去的感伤 2020-12-09 05:46

In devise, many of the pages that teach how to accomplish certain things require editing a sessions controller. I set up devise using this https://github.com/fortuity/rails3

相关标签:
1条回答
  • 2020-12-09 06:29

    Create your Sessions Controller with rails g controller MySessions. Then inside of your controller change it from inheriting from ApplicationController to the Devise Controller like so:

    class MySessionsController < Devise::SessionsController
    
    #your session logic here
    
    end
    

    Any of the logic within that controller that you want to override you can override by calling that method and inserting your own logic. For the list of what's in that controller, you can view the code on their Github page. If you do not wish to override their methods you can either leave them out, or just call super.

    def new
      super
    end
    
    0 讨论(0)
提交回复
热议问题