different layout for sign_in action in devise

后端 未结 8 2161
情深已故
情深已故 2020-12-02 05:12

I\'m trying to use a different/custom layout named \"devise\" for the sign_in action. I found this page in the devise wiki, and the second example even says you can do it pe

8条回答
  •  不思量自难忘°
    2020-12-02 05:52

    Here's a one-liner for those who want all devise actions to use a new layout:

    class ApplicationController < ActionController::Base
      protect_from_forgery
    
      layout Proc.new { |controller| controller.devise_controller? ? 'devise' : 'application' }
    end
    

提交回复
热议问题